We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28073
    • 164 Posts
    Dear all,

    Please pardon it though there might be strange sentences because I’m not good at English :’(

    Seems not to operate well though it tried to add ’Plugin Event’ by using the ’addEventListener function’ on executing MODx.
    Therefore, the source was corrected.

    ./manager/includes/document.parser.class.inc[line:about 2219]
    # add an event listner to a plugin - only for use within the currentexecution cycle
    function addEventListener($evtName, $pluginName) {
        if (!$evtName || !$pluginName)
            return false;
        $el= $this->pluginEvent[$evtName];
        if (empty ($el))
            $el= $this->pluginEvent[$evtName]= array ();
        return array_push($el, $pluginName); // return index
    }
    


    ↓

    # add an event listner to a plugin - only for use within the currentexecution cycle
    function addEventListener($evtName, $pluginName) {
        if (!$evtName || !$pluginName)
            return false;
        $el= &$this->pluginEvent[$evtName];
        if (empty ($el)){
            $this->pluginEvent[$evtName]= array ();
            $el= &$this->pluginEvent[$evtName];
        }
        return array_push($el, $pluginName); // return index
    


    Report this problem at bug report page?

    sincerely yours,
      • 27376
      • 576 Posts
      FS#991 - addEventListener API function not adding event.

      UPDATE: Should be fixed now in [tt]branches/096/[/tt] @ r3278
        • 28073
        • 164 Posts
        Thank you smiley