IIS/MySQL New Instal SQL Error: SQLSTATE[HY000]: General error: 1364 Field 'edit' doesn't have a default value

To be completed by the original poster:

CMS Version

2.3.0

Installation Method

IIS Custom Install, with mysql on a separate server

Operating System

Both Server 2016

Issue

With the issues I had upgrading my previous install I decided to start fresh, I went down the docker route but had problems getting Docker running on the server. Anyway, I followed the guide here:

When I had finished, I went to the new xibo URL and all the options were ticked, I put in my database info, clicked next and after a few minutes I had the following error:

SQLSTATE[HY000]: General error: 1364 Field 'edit' doesn't have a default value

`#0 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Db\Adapter\PdoAdapter.php(134): PDO->exec('INSERT INTO `pe...') #1 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Db\Adapter\AdapterWrapper.php(171): Phinx\Db\Adapter\PdoAdapter->execute('INSERT INTO `pe...') #2 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Migration\AbstractMigration.php(221): Phinx\Db\Adapter\AdapterWrapper->execute('INSERT INTO `pe...') #3 C:\inetpub\wwwroot\Xibo2\db\migrations\20191205180116_add_playlist_dashboard_page_user_migration.php(59): Phinx\Migration\AbstractMigration->execute('INSERT INTO `pe...') #4 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Migration\Manager\Environment.php(124): AddPlaylistDashboardPageUserMigration->change() #5 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Migration\Manager.php(375): Phinx\Migration\Manager\Environment->executeMigration(Object(AddPlaylistDashboardPageUserMigration), 'up') #6 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Migration\Manager.php(351): Phinx\Migration\Manager->executeMigration('production', Object(AddPlaylistDashboardPageUserMigration), 'up') #7 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Console\Command\Migrate.php(115): Phinx\Migration\Manager->migrate('production', 20200130165443) #8 C:\inetpub\wwwroot\Xibo2\vendor\symfony\console\Command\Command.php(255): Phinx\Console\Command\Migrate->execute(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\StreamOutput)) #9 C:\inetpub\wwwroot\Xibo2\vendor\symfony\console\Application.php(983): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\StreamOutput)) #10 C:\inetpub\wwwroot\Xibo2\vendor\symfony\console\Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Phinx\Console\Command\Migrate), Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\StreamOutput)) #11 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Console\PhinxApplication.php(86): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\StreamOutput)) #12 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Wrapper\TextWrapper.php(243): Phinx\Console\PhinxApplication->doRun(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\StreamOutput)) #13 C:\inetpub\wwwroot\Xibo2\vendor\robmorgan\phinx\src\Phinx\Wrapper\TextWrapper.php(129): Phinx\Wrapper\TextWrapper->executeRun(Array) #14 C:\inetpub\wwwroot\Xibo2\lib\Helper\Install.php(221): Phinx\Wrapper\TextWrapper->getMigrate() #15 C:\inetpub\wwwroot\Xibo2\lib\routes-install.php(51): Xibo\Helper\Install->Step3(Object(Xibo\Storage\PdoStorageService)) #16 [internal function]: {closure}('3') #17 C:\inetpub\wwwroot\Xibo2\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array) #18 C:\inetpub\wwwroot\Xibo2\vendor\slim\slim\Slim\Slim.php(1355): Slim\Route->dispatch() #19 C:\inetpub\wwwroot\Xibo2\vendor\slim\slim\Slim\Middleware\Flash.php(85): Slim\Slim->call() #20 C:\inetpub\wwwroot\Xibo2\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92): Slim\Middleware\Flash->call() #21 C:\inetpub\wwwroot\Xibo2\vendor\slim\slim\Slim\Slim.php(1300): Slim\Middleware\MethodOverride->call() #22 C:\inetpub\wwwroot\Xibo2\web\install\index.php(134): Slim\Slim->run() #23 {main}`

I’ve also tried running the command
ALTER TABLE permission MODIFY edit int(11) DEFAULT 0;

but I still have the error that the CMS us upgrading. I’m happy to start again, for the third time, just trying to figure out where I am going wrong on this one. Many thanks

Just going to give this a try.

The Fix is proposed to be:

// Set Playlist Dashboard Page Permission
    $this->execute('INSERT INTO `permission` (`entityId`, `groupId`, `objectId`, `view`, `edit`, `delete`) SELECT  '.$pageEntityId.', '.$groupId.', '.$playlistDashboardPageId.', 1, 0, 0');

    // Set Library Page Permission
    $this->execute('INSERT INTO `permission` (`entityId`, `groupId`, `objectId`, `view`, `edit`, `delete`) SELECT  '.$pageEntityId.', '.$groupId.', '.$libraryPageId.', 1, 0, 0');

    // Set Users Page Permission
    $this->execute('INSERT INTO `permission` (`entityId`, `groupId`, `objectId`, `view`, `edit`, `delete`) SELECT  '.$pageEntityId.', '.$groupId.', '.$userPageId.', 1, 0, 0');

This resolved the problem and has started with no issues.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.