Skip to content

[5.0] Remove "updateContentTypes" method from script.php#40281

Merged
HLeithner merged 2 commits intojoomla:5.0-devfrom
richard67:5.0-dev-script-php-clean-up-postflight-content-types
Apr 2, 2023
Merged

[5.0] Remove "updateContentTypes" method from script.php#40281
HLeithner merged 2 commits intojoomla:5.0-devfrom
richard67:5.0-dev-script-php-clean-up-postflight-content-types

Conversation

@richard67
Copy link
Member

@richard67 richard67 commented Apr 1, 2023

Pull Request for Issue # .

Summary of Changes

This pull request (PR) removes the method "updateContentTypes" and calls to it from file "administrator/components/com_admin/script.php".

The method once had been added with PR #28364 for updating the #__content_types table with fully qualified class names when updating from 3.10 to 4.x.

As you can see here, the removed call is only executed in the "postflight" method when updating from anything older than 4.0.0:
https://github.com/richard67/joomla-cms/blob/5.0-dev/administrator/components/com_admin/script.php#L885-L887

The PR is one in a sequence of PR's for removing obsolete actions from script.php which are not relevant anymore because updates to 5.x will have to be done from a 4.4 version, like it is now with 4.x from 3.10.

When this PR here and PR #40280 have been merged, the "postflight" method will not do anything anymore.

I will make a follow up PR when that has happened to change the version number in the version_compare call from 4.0.0to 5.0.0 here https://github.com/richard67/joomla-cms/blob/5.0-dev/administrator/components/com_admin/script.php#L885-L887 and below that add a comment like // Add here code which shall only be performed when updating from 4.4 to 5.x or so.

The "postflight" method should be kept for such future use, I think.

Other opinions are welcome.

Testing Instructions

Code review: Make sure that the removed method is not called anywhere else and that it does something which is definitely not needed when updating from 4.4 to 5.

Optional real test: Make sure that updating the latest 4.4-dev nightly build to the update package created by drone works when using the upload & update method.

Actual result BEFORE applying this Pull Request

Obsolete code for updating the #__content_types table with fully qualified class names when updating from 3.10 to 4.x is present in script.php.

Expected result AFTER applying this Pull Request

Obsolete code for updating the #__content_types table with fully qualified class names when updating from 3.10 to 4.x is not present anymore in script.php.

Updating from a 4.4-dev nightly build works.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

@brianteeman
Copy link
Contributor

perhaps in future it will be easier to remember to remove this sort of stuff if we get in the practice of marking when it should be removed at the same time when the code is added

…ht-content-types

# Conflicts:
#	administrator/components/com_admin/script.php
@HLeithner HLeithner merged commit fe215be into joomla:5.0-dev Apr 2, 2023
@HLeithner
Copy link
Member

thanks

@richard67 richard67 deleted the 5.0-dev-script-php-clean-up-postflight-content-types branch April 2, 2023 09:10
@richard67 richard67 added this to the Joomla! 5.0 milestone Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants