Defining custom views

Events happening in the community are now at Drupal community events on www.drupal.org.
beautifulmind's picture

Hello Views developers!

I read the mission statement of the group and I got some relief:

This group exists as a place for people interested in the group to talk about Views development; all development talk is encouraged here, from people who want to work on Views core to people who are interested in Views' API for their own modules.

I am developing views for my custom modules, but having problem with handlers. I can't figure out how to use those handlers.
I defined handlers but when I select the filter I added to the views it shows and error:

Error: handler for my_table > my_field doesn't exist!

Any help?

Regards.

Comments

clever man

pragna's picture

you are clever, so you can do it

hook_views_handlers

pasqualle's picture

you need the hook_views_handlers() hook
The full documentation for this hook is in the advanced help.

*_*

beautifulmind's picture

Yes I did write the hook_views_handlers(), but any how, it doesn't help.
Also, I've done as mentioned with advanced help section.

Thanks for reply.

:)
Beautifulmind

*_*

beautifulmind's picture

Now am able to add handler I defined for my module but now it throws following error message:

An error occurred at http://mydomain/admin/build/views/ajax/add-item/my_view/page_1/filter.

The error is a javascript alert.

I think, still there is something that am missing in my module. If you have any links for how to defined handlers, it would be help me a lot.

Regards.

:)
Beautifulmind

how to see the original error

pasqualle's picture

disable javascript in your browser to see the original error

*_*

beautifulmind's picture

That solved my problem!!
Thanks a lot. But when previewing the view, I see an error in which the filter I added does not replaced with value.
Instead it shows Array() in the query.

I use the following code in my plugin.

$this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field "
. (empty($this->value) ? '!=' : '=') . " CURRENT_USER");

Its the same as in views_handler_filter_user_current.inc in views.

:)
Beautifulmind

more info needed

pasqualle's picture

If it is the same then the problem should be somewhere else. Can you post the full code of your handler?

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: