Page 1 of 1

1.10.1 Module no longer receives ContentPreCompile events

Posted: Sat Nov 12, 2011 6:15 pm
by dbuenzli
Hello,

I tried an upgrade to 1.10.1 but one of my module no longer receives ContentPreCompile events (cf. below for the relevant parts). Does anybody know where that could come from ?

Btw. is the plugin api formally documented somewhere ?

Thanks.

Daniel

Code: Select all

  function IsPluginModule () { return false; } 
  function HandlesEvents () { return true; }
  function GetDependencies () { return array(); }
  function MinimumCMSVersion() { return '1.9.1'; }
  function SetParameters ()
  {
    $this->AddEventHandler ('Core', 'ContentPreCompile', true);
    $this->AddEventHandler ('Core', 'GlobalContentPreCompile', true );
  }

  function DoEvent($o, $e, &$p)
  {
    debug_to_log('DoEvent');
    if ($o == 'Core') {
      if ($e == 'ContentPreCompile') 
      { debug_to_log('ContentPreCompile'); }
      else if ($e == 'GlobalContentPreCompile')
      { debug_to_log('GlobalContentPreCompile'); }
    }
  }

Re: 1.10.1 Module no longer receives ContentPreCompile event

Posted: Sat Nov 12, 2011 7:12 pm
by staartmees
does your admin log shows errors?
turn debugmode on in your config.php and look for errors there.

Re: 1.10.1 Module no longer receives ContentPreCompile event

Posted: Sun Nov 13, 2011 12:28 pm
by dbuenzli
Couldn't find anything meaningful in the errors.

Here's a repro case. In the module Silent below, DoEvent gets called at the right time on a clean install of 1.9.4.3. It is never called on a clean install of 1.10.1.

Best,

Daniel

Code: Select all

<?php
class Silent extends CMSModule
{
  public function __construct()
  {
    parent::__construct();
    debug_to_log('Silent: construct');
  }

  function GetName () { return 'Silent'; }
  function GetFriendlyName () { return 'Silent'; }
  function GetVersion () { return 'Bla'; }
  function GetAuthor () { return 'Bla'; }
  function GetAuthorEmail () { return 'Bla'; }
  function GetHelp () { return 'Bla'; }
  function IsPluginModule () { return false; } 
  function HandlesEvents () { return true; }
  function GetDependencies () { return array(); }
  function MinimumCMSVersion () { return '1.9.1'; }
  function Install () 
  {
    debug_to_log('Silent: Install');
    $this->AddEventHandler ('Core', 'ContentPreCompile', true);
    $this->AddEventHandler ('Core', 'GlobalContentPreCompile', true );
  }
  
  function Uninstall ()
  {
    debug_to_log('Silent: Uninstall');
    $this->RemoveEventHandler ('Core', 'ContentPreCompile');
    $this->RemoveEventHandler ('Core', 'GlobalContentPreCompile');
  }

  function DoEvent($o, $e, &$p)
  {
    debug_to_log('Silent: DoEvent');
  }
}
?>