? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
6 Jun 2021

Pull Request for Issue #34362 .

Summary of Changes

At the end of a core update, especially to a new major version, it may happen that there are structural changes on columns of the extensions table applied by the update SQL scripts, e.g. like real NULL values and no default value for the checked_out_time column.

But the installer object still uses old, cached information about these columns even if you create a new installer object, and so uses the old default values for such columns when loading the extensions table in its constructor.

When after running the update SQL scripts the manifest cache of all core extensions is updated, this results in the old default values being written for columns like e.g. the checked_out_time column, where the old zero date '0000-00-00 00:00:00' on MySQL and MariaDB or '1970-01-01 00:00:00' on PostgreSQL are used when storing the table.

This result in issue #34362 .

This pull request (PR) fixes that by calling the getFields method of the installer's extensions table object with the $reload parameter set to true just after the schema updates have run, so the table columns properties are read again from database with the new table structure.

That getFields is the one of the parent class here: https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Table/Table.php#L242

Testing Instructions

  1. Update a clean 3.10 Alpha 6 or latest 3.10- nightly or a current 3.10-dev branch to 4.0 RC 1 or latest 4.0 nightly.

  2. After the update has finished, go to "System -> Maintenance -> Global Check-in".
    Result: See section "Actual result BEFORE applying this Pull Request" below.

  3. Update a clean 3.10 Alpha 6 or latest 3.10- nightly or a current 3.10-dev branch to the patched package built buy drone for this PR using either the custom update URL or the zip package.

  4. After the update has finished, go to "System -> Maintenance -> Global Check-in".
    Result: See section "Expected result AFTER applying this Pull Request" below.

Actual result BEFORE applying this Pull Request

A lot of items (215 on a clean and empty installation) are shown to be checked it for the the #___extensions table.

In fact these are all records of that table.

If you go to "System -> Manage -> Extensions", everything looks ok, nothing is checked out.

If you check in database you will see that the checked_out column is zero for all extensions, but the checked_out_time column doesn't have value NULL but has the old style (peudo) null dates ('0000-00-00 00:00:00' on MySQL or MariaDB and '1970-01-01 00:00:00' on PostgreSQL databases).

Checking in the items in Global Check-In works, i.e. after that they are not shown as checked out anymore.

Expected result AFTER applying this Pull Request

Nothing to be checked in which was not to be checked in before the update (which should be nothing when updating from a clean 3.10).

Documentation Changes Required

None.

avatar richard67 richard67 - open - 6 Jun 2021
avatar richard67 richard67 - change - 6 Jun 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jun 2021
Category Administration com_admin
avatar joomdonation joomdonation - test_item - 6 Jun 2021 - Tested successfully
avatar joomdonation
joomdonation - comment - 6 Jun 2021

I have tested this item successfully on c42b507


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34433.

avatar PhilETaylor PhilETaylor - test_item - 6 Jun 2021 - Tested successfully
avatar PhilETaylor
PhilETaylor - comment - 6 Jun 2021

I have tested this item successfully on c42b507

Code review only


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34433.

avatar chmst chmst - test_item - 6 Jun 2021 - Tested successfully
avatar chmst
chmst - comment - 6 Jun 2021

I have tested this item successfully on c42b507


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34433.

avatar richard67 richard67 - change - 6 Jun 2021
Status Pending Ready to Commit
Labels Added: ?
avatar richard67
richard67 - comment - 6 Jun 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34433.

avatar richard67 richard67 - change - 6 Jun 2021
The description was changed
avatar richard67 richard67 - edited - 6 Jun 2021
avatar richard67 richard67 - change - 6 Jun 2021
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jun 2021
Category Administration com_admin Administration com_joomlaupdate
avatar richard67 richard67 - change - 6 Jun 2021
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 6 Jun 2021

Back to pending.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34433.

avatar richard67
richard67 - comment - 6 Jun 2021

Sorry all but after talk with @wilsonge I had to make a change. I've moved the fix from script.php to the joomlaupdate mode.

The fix is still the same and happens at the same point of the update, just the code has been moved.

Please test again. Thanks in advance.

avatar richard67 richard67 - edited - 6 Jun 2021
avatar richard67 richard67 - change - 6 Jun 2021
The description was changed
avatar wilsonge wilsonge - change - 6 Jun 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-06-06 20:46:30
Closed_By wilsonge
Labels Added: ?
Removed: ? ?
avatar wilsonge wilsonge - close - 6 Jun 2021
avatar wilsonge wilsonge - merge - 6 Jun 2021
avatar wilsonge
wilsonge - comment - 6 Jun 2021

I'm happy with just the code moving to merge after the previous tests. Thanks all!

avatar richard67
richard67 - comment - 6 Jun 2021

Thanks all!

Add a Comment

Login with GitHub to post a comment