Skip to content

Quick'n'dirty bugfix: Can't set poll as inactive

Bandie requested to merge Bandie/framadate:patch-2 into develop

When you try to set the poll as inactive via the admin UI, you receive an exception, saying that it can't put '' into the column active:

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: 
General error: 1366 Incorrect integer value: '' for column 'active' at row 1 in /var/www/framadate/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117 

Stack trace: 
#0 /var/www/framadate/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(Array) 
#1 /var/www/framadate/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1058): Doctrine\DBAL\Driver\PDOStatement->execute(Array) 
#2 /var/www/framadate/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(739): Doctrine\DBAL\Connection->executeUpdate('UPDATE fd_poll ...', Array, Array) 
#3 /var/www/framadate/app/classes/Framadate/Repositories/PollRepository.php(123): Doctrine\DBAL\Connection->update('fd_poll', Array, Array) 
#4 /var/www/framadate/app/classes/Framadate/Services/AdminPollService.php(48): Framadate\Repositories\PollRepository->update(Object(stdClass)) 
#5 /var/www/framadate/adminstuds.php(192): Framadate\Services\AdminPollService->updatePoll(Object(stdClass)) 
#6 in /var/www/framadate/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 106

To fix that, we should cast $poll->active as int.

Merge request reports