Fork me on GitHub

hook filter problem  Bottom

  • I have problems with the new hook system

    I want to add a filter hook but it does not work. Here what I done:

    First I added the filter provider in Version.php

    Code

    protected function setupHookBundles()
    {
     $bundle = new Zikula_HookManager_ProviderBundle($this->name, 'provider.lumicula.filter_hooks.description', 'filter_hooks', $this->__('LuMicuLa Event Maker'));
     $bundle->addServiceHandler('filter', 'LuMicuLa_HookHandlers', 'filter', 'lumicula.service');
     $this->registerHookProviderBundle($bundle);                
    }


    After a reinstall of the module I could see the hook in the hook drop and drag menus of the modules.

    If I drop it to a filter area (eg. News Display Hooks (subscriber.news.filter_hooks.articles) everthing seems to be fine. But after a reload the area is still empty.

    What I'm doing wrong?

    --
    https://github.com/phaidon/
  • you need to change

    Code

    $bundle->addServiceHandler('filter', 'LuMicuLa_HookHandlers', 'filter', 'lumicula.service');

    to

    Code

    $bundle->addStaticHandler('filter', 'LuMicuLa_HookHandlers', 'filter', true);


    take a look at this example MyHookProvider.

    If it's still not working, please log a ticket at the Cozi.

    Aren't you getting any error messages when you attach the provider (Lumicula) to a subcriber (News)?
  • Thanks for the hints, but unfortunately nothing changes.

    I have the same problem with MyHookProvider. The ui_hooks works fine, but the filter_hooks don't work. So it seems to be a Zikula problem.

    Unfortunately there is no error message, even I set the logs to level 7.

    --
    https://github.com/phaidon/
  • If your definitions were wrong you will have to uninstall the module and reinstall to get the right values in the database.

    I checked out the UI with News + MyHookProvider and it's working ok from those two.

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • I could fix some problems with MyHookProvider. There was a problem with a database field. Now the activation works. But I still got an error:

    Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /var/www/z/lib/Zikula/HookManager.php on line 302

    I got this error with a fresh Zikula installation, too.

    The problem seems to be related with the field serviceid in z_hook_runtime. It just occurs if the value is null.

    Zikula is up-to-date (git).

    EDIT: If I do the following it works:

    1. Replace the null value by myhookprovider.mhp (z_hook_runtime/serviceid)
    2. Replace public function ui_filter(Zikula_FilterHook $hook) by public function filter(Zikula_FilterHook $hook) ( in modules/MyHookProvider/lib/MyHookProvider/HookHandler/Mhp.php)



    Edited by phaidon on May 26, 2011 - 06:52 AM.

    --
    https://github.com/phaidon/
  • 0 users

This list is based on users active over the last 60 minutes.