- Affected version
- 2.0.10
Trying to install version 2.0.0 Beta 2, but getting this error when hitting the Install button:
ErrorException: [E_WARNING] Illegal offset type in isset or empty in src/XF/Db/Schema/Index.php at line 191
- XF::handlePhpError() in src/XF/Db/Schema/Index.php at line 191
- XF\Db\Schema\Index->getDefinition() in src/XF/Db/Schema/Alter.php at line 254
- XF\Db\Schema\Alter->getQueries() in src/XF/Db/Schema/AbstractDdl.php at line 147
- XF\Db\Schema\AbstractDdl->apply() in src/XF/Db/SchemaManager.php at line 143
- XF\Db\SchemaManager->alterTable() in src/addons/AVForums/TagEssentials/Setup.php at line 34
- AVForums\TagEssentials\Setup->installStep1() in src/XF/AddOn/StepRunnerInstallTrait.php at line 60
- AVForums\TagEssentials\Setup->installStepRunner() in src/XF/AddOn/StepRunnerInstallTrait.php at line 27
- AVForums\TagEssentials\Setup->install() in src/XF/Admin/Controller/AddOn.php at line 393
- XF\Admin\Controller\AddOn->actionInstall() in src/XF/Mvc/Dispatcher.php at line 249
- XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
- XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
- XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
- XF\App->run() in src/XF.php at line 329
- XF::runApp() in admin.php at line 13
Caused by the effective following code;
PHP:
public function installStep1()
{
$this->schemaManager()->createTable('xf_tagess_blacklist', function (Create $table) {
$table->addColumn('blacklist_id', 'int')->autoIncrement()->primaryKey();
$table->addColumn('tag', 'varchar', 255);
$table->addColumn('regex', 'tinyint', 1)->setDefault(0);
$table->addColumn('user_id', 'int');
$table->addColumn('blacklisted_date', 'int')->nullable(true)->setDefault(null);
$table->addKey(['regex',['tag', 191]], 'tag');
});
$this->schemaManager()->alterTable('xf_tagess_blacklist', function (Alter $table) {
$table->addKey(['regex',['tag', 191]], 'tag');
});
}
Normally this would update/change the index 'tag', but with a partial index the column definition is returned as
['regex',['tag', 191]]
which causes the test if (isset($conflictRenames[$column]))
to fail with "Illegal offset type in isset or empty".I require the partial index to support older version of MySQL which do not support index over columns longer than 255 bytes.
Last edited: