1.10.1 Module no longer receives ContentPreCompile events

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
dbuenzli
Forum Members
Forum Members
Posts: 12
Joined: Sat Nov 12, 2011 6:07 pm

1.10.1 Module no longer receives ContentPreCompile events

Post 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'); }
    }
  }
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: 1.10.1 Module no longer receives ContentPreCompile event

Post by staartmees »

does your admin log shows errors?
turn debugmode on in your config.php and look for errors there.
dbuenzli
Forum Members
Forum Members
Posts: 12
Joined: Sat Nov 12, 2011 6:07 pm

Re: 1.10.1 Module no longer receives ContentPreCompile event

Post 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');
  }
}
?>
Post Reply

Return to “Developers Discussion”