Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 10, 20213 yr @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.
August 10, 20213 yr Author 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; }
August 10, 20213 yr Solution 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', ...
August 10, 20213 yr Author Your columns should have an array key that matches the column name so... Ooh ok. I'll change it.
August 10, 20213 yr 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)
August 11, 20213 yr 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, 20213 yr by Afrodude
August 11, 20213 yr Author 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.