Jump to content

Recommended Posts

Posted

Anyone else getting these error messages while editing Hooks in development mode?

Could contain: File, Text, Computer Hardware, Electronics, Hardware

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?

 

Posted
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, '' );
		}
	}

 

Posted
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.

Posted

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?

 

Posted

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.

 

  • 3 weeks later...
Posted
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 Could contain: Page, Text, File?

Posted
2 hours ago, Daniel F said:

I'm having trouble reproducing this. Do you mean these links Could contain: Page, Text, File?

Yes, once you delete a hook and the page refreshes, editing another hook will/should result in this error message:

Could contain: File, Text, Computer Hardware, Electronics, Hardware

As you can see, I have just reproduced this again.

Could contain: File, Page, Text, Webpage

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?!

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...