Jump to content

Error on plugin install in PHP 8


Go to solution Solved by Stuart Silvester,

Recommended Posts

@Daniel F @Stuart Silvester

I think there's a bug on plugin install if this plugin creates a table. You should be using PHP 8 and with IN_DEV enabled. The error:

12RG1YB.png

The error happens in the step that has the \IPS\Db::i()->createTable.

If you disable the IN_DEV or install the plugin in PHP 7.4, it works just fine. Tested in several plugins, 3 installs.

Link to comment
Share on other sites

One of them:

	public function step1()
	{
		\IPS\Db::i()->createTable( array(
			'name'		=> 'savedactionssorting_mm',
			'columns'	=> array(
				array(
					'name'			=> 'sas_mm_id',
					'type'			=> 'smallint',
					'length'		=> 6,
					'allow_null'		=> false,
					'auto_increment'	=> false,
					'default'		=> 0
				),
				array(
					'name'			=> 'sas_mm_position',
					'type'			=> 'smallint',
					'length'		=> 6,
					'allow_null'		=> false,
					'default'		=> 0
				),
			),
			'indexes'	=> array(
				array(
					'type'		=> 'primary',
					'columns'	=> array( 'sas_mm_id' )
				)
			)
		)	);

		return TRUE;
	}

 

Link to comment
Share on other sites

3 hours ago, sobrenome said:

Is it already safe to use php 8 with IPS 4.6?

Yes. IPS 4.6 supporting PHP 8, but be careful from third-party plugins or applications because some of them might have issues will lead to error HTTP 500. If you do have this issue, you must report it to the third-party developer. 

Edited by Afrodude
Link to comment
Share on other sites

11 hours ago, Stuart Silvester said:

You're better off to use an Application if you're creating tables anyway, all this is handled automatically (as well as the database checker and uninstallation)

That’s ok as long as you use the plugin uninstall to drop your table. Also, it works fine (no log error and table is created) with IN_DEV disabled so it’s ok.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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