-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
J4: MysqlDriver::insertObject vs DatabaseDriver::updateObject #35520
Comments
That should be reported here https://github.com/joomla-framework/database/issues for the 2.0-dev branch (which is used in Joomla 4). |
in this way is a bit generic imo, can you please post an example (code) |
example code - to be run as domain.com/test.php directly
result:
best regards, stan |
Closing here as it will be handled in the framework repository, see joomla-framework/database#255 . @stAn47 Thanks for reporting. |
thank you @stAn47 |
Steps to reproduce the issue
reproduce:
insert a row where DateTime column is '0' -> in this case insertion does not fail and a new row is inserted
update a row where DateTime column is '0' -> an error is provided from mysql (Incorrect datetime value: '0' for column... )
Expected result
there seems to be a code inconsitancy in Joomla 4 database drivers as insertObject ignores some of the columns with code:
\libraries\vendor\joomla\database\src\Mysql\MysqlDriver.php
while updateObject does not use same logic as above:
\libraries\vendor\joomla\database\src\DatabaseDriver.php
i believe both of them should use same definition on columns which are going to be ignored.
best regards, stan
The text was updated successfully, but these errors were encountered: