User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This PR fixes all datetime columns of the com_menus component's database table #__menu so there will not be any Invalid value '0000-00-00 00:00:00' for datetime error anymore on MySQL 5.7 or later when strict mode is enabled.
In opposite to PR #26372 , this PR here does not depend on PR #26295 , because this one here does not have anything to change in table #__ucm_content.
Because columns publish_up and publish_down have been added in 4.0, the sql update scripts 4.0.0-2019-03-30.sql which were used for this purpose can also be used for doing the schema changes of this PR.
In addition, the update scripts 4.0.0-2019-09-13.sql are changed because they insert a record into the menu table.
The joomla.sql scripts is changed so the core menu records are inserted excplicitely with null values for the datetime columns, like we do it elsewhere.
Finally, PHP code is changed so that the table supports null values.
Note on updating old 4.0 sql update scripts
Since we are not in Beta phase yet and so don't have to support updates from 4.0-Alpha-x to 4.0-Alpha-y or between nightly builds, we can change the existing 4.0 update scripts (but of course not pre-4.0 scripts). Later when in beta this will not be allowed anymore because we have to support updating from Beta-x to Beta-y (with y > x of course), so now is a good time to fix them.
Furthermore it makes sense to keep the schema updates for the datetime columns of each table together in one script, because on MySQL it might be necessary to combine all changes for a particular table into 1 single ALTER TABLE statement in order to run properly in strict mode (i.e. strict tables enabled). Currently the db checker/fixer can't understand such statements, but it might be necessary to teach that tool soon to do that.
That's why this PR updates the existing sql update script and doesn't create a new one.
New Installation
configuration.php and delete all Joomla database tables in PhpMyAdmin or PhpPgAdmin (depending on your database type).datetime/timestamp without timezone columns.Update from 3.9.12 or staging
datetime/timestamp without timezone columns.New Installation
Menus work as well as without this PR. In a MySQL database there are no columns publish_up or publish_down or checked_out_time having value '0000-00-00 00:00:00' in table #__menu, and there is no invalid default value anymore in MySQL >= 5.7 with strict mode on.
Update from 3.9.12 or staging
Update works, no errors in SQL or PHP about workflows. Rest see above for new installation.
New Installation
On MySQL same as expected, but the default value of database columns publish_up or publish_down or checked_out_time of table #__menu is invalid in MySQL >= 5.7 with strict mode on, and there might be values '0000-00-00 00:00:00'. On postgreSQL same as expected, but there might be values '1970-01-01 00:00:00' in the datetime columns of the menu table.
Update from 3.9.12 or staging
See new installation.
Maybe core developer docs and extension developer docs should be updated to encourage them not to use '0000-00-00 00:00:00' on MySQL anymore but use real NULL and not abuse '1970-01-01 00:00:00' on PostgreSQL as a speudo null date anymore and use real NULL values also there.
| Status | New | ⇒ | Pending |
| Category | ⇒ | SQL Administration com_admin Postgresql |
| Labels |
Added:
?
|
||
| Category | SQL Administration com_admin Postgresql | ⇒ | SQL Administration com_admin Postgresql Libraries |
| Category | SQL Administration com_admin Postgresql Libraries | ⇒ | SQL Administration com_admin Postgresql Installation Libraries |
| Category | SQL Administration com_admin Postgresql Libraries Installation | ⇒ | SQL Administration com_admin Postgresql com_menus Installation Libraries |
| Title |
|
||||||
I have tested this item
5.5.5-10.4.6-MariaDB
I have tested this item
on 8.0.16-0ubuntu3
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-03 15:13:11 |
| Closed_By | ⇒ | wilsonge | |
| Labels |
Added:
?
|
||
Thanks!
Ready for review and test.
@wilsonge Please review.
@alikon @Quy @SharkyKZ Could you review and/or test, too?