Defining custom views

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.

Login to post comments

clever man

pragna's picture
pragna - Sat, 2008-11-29 11:22

you are clever, so you can do it


hook_views_handlers

Pasqualle - Sat, 2008-11-29 16:01

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


*_*

beautifulmind's picture
beautifulmind - Mon, 2008-12-01 04:17

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
beautifulmind - Mon, 2008-12-01 05:17

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

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 - Mon, 2008-12-01 10:35

disable javascript in your browser to see the original error


*_*

beautifulmind's picture
beautifulmind - Tue, 2008-12-02 10:32

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 - Tue, 2008-12-02 13:40

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