1

My company has a legacy add-on from version 2 and has now updated to version 4 of EE. With the upgrade, the hooks that fire when a new entry of a specific channel type are no longer triggering.

After some research, it looks like the issue that the hook names are wrong. The code defining them is below.

   public function activate_extension() {
   
       // Setup custom settings in this array.
       $this->settings = array();
       
       $entrySubmissionBeginHook = array(
           'class'     => __CLASS__,
           'method'    => 'entrySubmissionBegin',
           'hook'      => 'entry_submission_ready',
           'settings'  => serialize($this->settings),
           'version'   => $this->version,
           'enabled'   => 'y'
       );
       
       $entrySubmissionEndHook = array(
           'class'     => __CLASS__,
           'method'    => 'entrySubmissionEnd',
           'hook'      => 'entry_submission_end',
           'settings'  => serialize($this->settings),
           'version'   => $this->version,
           'enabled'   => 'y'
       );
       
       $deleteEntriesStarthook = array(
           'class'     => __CLASS__,
           'method'    => 'deleteEntriesStart',
           'hook'      => 'delete_entries_start',
           'settings'  => serialize($this->settings),
           'version'   => $this->version,
           'enabled'   => 'y'
       );
       
       ee()->db->insert('extensions', $entrySubmissionBeginHook);
       ee()->db->insert('extensions', $entrySubmissionEndHook);
       ee()->db->insert('extensions', $deleteEntriesStarthook);
   }   


       
       
       
   
   
2

There were certainly several extension hook changes with the arrival of EE3, possibly with EE4 too, so you may well need to update the naming of the hooks in your addon.

You can find a complete list of the hooks available in EE 4 in the documentation.

HTH

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.