Jump to content

2C103/Q Error.


Recommended Posts

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?

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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