TDBF Posted July 10 Posted July 10 Anyone else getting these error messages while editing Hooks in development mode? I thought this might have been due to the issues that I was having previously, but after checking all my logs, I have found no issues. For the time being, I have disabled Mod Security on my dev site, and I am still getting this error. Any suggestions? Â
Adriano Faria Posted July 10 Posted July 10 9 minutes ago, TDBF said: Any suggestions? Do a project search for the error code to see why you’re having it.
TDBF Posted July 11 Author Posted July 11 1 hour ago, Adriano Faria said: Do a project search for the error code to see why you’re having it. I already have, hence why I am asking here if anyone else is experiencing the same thing. The error is specific to editing hooks: /** * Edit Hook * * @csrfChecked uses $hook->editForm() 7 Oct 2019 * @return string */ protected function editHook() { try { if ( \IPS\Request::i()->hookApp and \IPS\Request::i()->hookFilename ) { $hook = \IPS\Plugin\Hook::constructFromData( \IPS\Db::i()->select( '*', 'core_hooks', array( 'app=? AND filename=?', \IPS\Request::i()->hookApp, \IPS\Request::i()->hookFilename ) )->first() ); } else { $hook = \IPS\Plugin\Hook::load( \IPS\Request::i()->hook ); } $hook->editForm( \IPS\Http\Url::internal( "app=core&module=applications&controller=developer&appKey={$this->application->directory}&tab=hooks" ) ); } catch ( \Exception $e ) { \IPS\Output::i()->error( 'node_error', '2C103/Q', 404, '' ); } } Â
Adriano Faria Posted July 11 Posted July 11 Change 'node_error' to $e->getMessage() and you’ll get the exact error. TDBF 1
TDBF Posted July 11 Author Posted July 11 10 minutes ago, Adriano Faria said: Change 'node_error' to $e->getMessage() and you’ll get the exact error. Typical, now that I want to debug this, I'm no longer getting the error when editing hooks. 😂 The error's did not happen all the time, and seemed random, but more so after deleting another hook. If it happens again, I will post any error message/s.
TDBF Posted July 11 Author Posted July 11 This looks like a bug, as I can now reproduce the behaviour. When a hook is deleted, a subsequent hook edit will reference the deleted hook's ID. This leads to an error because the deleted hook's ID no longer exists in the database. This issue seems to stem from how the page refreshes and reorders the hooks after a deletion. The hook IDs seem to get misaligned, causing the incorrect hook ID to be used the next time a hook is edited. Manually refreshing the page after deleting a hook realigns the IDs correctly in the table, preventing an error when editing another hook. I can only assume that this is an issue related to JavaScript? Â SeNioR- 1
Marc Posted July 11 Posted July 11 Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release. Â TDBF 1
Daniel F Posted July 31 Posted July 31 On 7/11/2024 at 4:38 AM, TDBF said: This issue seems to stem from how the page refreshes and reorders the hooks after a deletion. The hook IDs seem to get misaligned, causing the incorrect hook ID to be used the next time a hook is edited. I'm having trouble reproducing this. Do you mean these links ?
TDBF Posted July 31 Author Posted July 31 2 hours ago, Daniel F said: I'm having trouble reproducing this. Do you mean these links ? Yes, once you delete a hook and the page refreshes, editing another hook will/should result in this error message: As you can see, I have just reproduced this again. After you created the hooks, did you build the Application and download it? I just created a Test app for this, and created hooks and deleted them without issues. It wasn't until I built the app and downloaded it that I started getting the error. Hope this helps?! SeNioR- 1
TDBF Posted August 1 Author Posted August 1 2 minutes ago, Daniel F said: yes Glad I was able to help! 🙂Â
Recommended Posts