Jefferson49 / Joomla_plugin_sexypolling_reloaded

Migration of the joomla plugin "Sexy Polling" to joomla 4.x
GNU General Public License v3.0
2 stars 3 forks source link

aju65_sexy_polls table #38

Closed thodorisgo closed 1 year ago

thodorisgo commented 1 year ago

While trying from Maintenance: Global Check-in to check in to aju65_sexy_polls table i recieve the error Field 'checked_out' doesn't have a default value

Jefferson49 commented 1 year ago

Thank you for reporting this special issue.

While trying to reproduce, I was not able to to check out a poll directly. However, after setting "checked_out" = "1" for a poll directly in the database, I could reproduce the mentioned error in System / Maintenance / Global Check-in.

Stack trace: An error has occurred. 1364 Field 'checked_out' doesn't have a default value Call stack Function Location 1 () JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:141 2 Joomla\Database\Mysqli\MysqliStatement->__construct() JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1048 3 Joomla\Database\Mysqli\MysqliDriver->prepareStatement() JROOT/libraries/vendor/joomla/database/src/DatabaseDriver.php:1900 4 Joomla\Database\DatabaseDriver->setQuery() JROOT/administrator/components/com_checkin/src/Model/CheckinModel.php:127 5 Joomla\Component\Checkin\Administrator\Model\CheckinModel->checkin() JROOT/administrator/components/com_checkin/src/Controller/DisplayController.php:69 6 Joomla\Component\Checkin\Administrator\Controller\DisplayController->checkin() JROOT/libraries/src/MVC/Controller/BaseController.php:672 7 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143 8 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:355 9 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143 10 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186 11 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:294 12 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61 13 require_once() JROOT/administrator/index.php:32

Jefferson49 commented 1 year ago

Since Joomla 4, the database behavior is more strict and it is not allowed to write empty values to the database if no default value is defined.

In this case, the error cannot be fixed in the PHP code of the plugin, because the related code is part of the general Joomla system.

The only way to solve this is to update the database settings for all Joomla 4 installations. I have to think about this.

Jefferson49 commented 1 year ago

As a short term workaround, you can use phpMyAdmin to directly access your aju65_sexy_polls table in the database. Search for the related poll and set "checked_out" = "0".

Jefferson49 commented 1 year ago

Just recognized that this is probably the same issue like #27, which is also still open.