Adriano Faria Posted August 10, 2021 Posted August 10, 2021 @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: 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. sobrenome 1
Stuart Silvester Posted August 10, 2021 Posted August 10, 2021 What is your create table code? sobrenome 1
Adriano Faria Posted August 10, 2021 Author Posted August 10, 2021 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; } sobrenome 1
Solution Stuart Silvester Posted August 10, 2021 Solution Posted August 10, 2021 Your columns should have an array key that matches the column name so... ... 'columns' => array( 'sas_mm_id' => array( 'name' => 'sas_mm_id', 'type' => 'smallint', ... Adriano Faria and sobrenome 1 1
Adriano Faria Posted August 10, 2021 Author Posted August 10, 2021 5 minutes ago, Stuart Silvester said: Your columns should have an array key that matches the column name so... Ooh ok. I'll change it. sobrenome 1
Stuart Silvester Posted August 10, 2021 Posted August 10, 2021 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) sobrenome 1
sobrenome Posted August 10, 2021 Posted August 10, 2021 Is it already safe to use php 8 with IPS 4.6?
Afrodude Posted August 11, 2021 Posted August 11, 2021 (edited) 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 August 11, 2021 by Afrodude sobrenome 1
Adriano Faria Posted August 11, 2021 Author Posted August 11, 2021 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. sobrenome 1
Recommended Posts