? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
3 Aug 2021

Pull Request for Issue # .

Summary of Changes

This pull request (PR) removes misleading information from a code comment.

We once have implemented the ExtensionHelper to safely determine if an extension is core or not because the formerly used criterion "extension_id < 10000" is not fulfilled on sites with a longer update history where the "copy the files, run the database fixer and do a discovery installation" method once was used when that method was documented to be valid.

All checks for "extension_id < 10000" have been replaced by using the ExtensionHelper.

But the comment fixed by this PR here still tells the old way, and this is dangerous in case if someone with old experience wants to contribute and finds it and thinks that's the way it has to be done.

In addition this PR extends the same comment regarding discovered extensions so it's more clear (as suggested by @brianteeman ).

Testing Instructions

Code review: Check that the SQL statement below the comment changed by this PR does not use any hard-coded value of 10000 in the where but uses
->where($db->quoteName('extension_id') . ' NOT IN (' . $joomlaCoreExtensionIds . ')')
to limit the extension_id to get core extensions only.

See https://github.com/richard67/joomla-cms/blob/202fa5cb040b18d0685dd52ec5c6f623f42053ff/administrator/components/com_installer/models/updatesites.php#L334-L347 .

Actual result BEFORE applying this Pull Request

Comment tells that core extensions have an extension_id lower than 10000 but that's not always true.

Expected result AFTER applying this Pull Request

Misleading part of the comment removed.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 3 Aug 2021
avatar richard67 richard67 - change - 3 Aug 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Aug 2021
Category Administration com_installer
avatar richard67 richard67 - change - 3 Aug 2021
The description was changed
avatar richard67 richard67 - edited - 3 Aug 2021
avatar richard67 richard67 - change - 3 Aug 2021
The description was changed
avatar richard67 richard67 - edited - 3 Aug 2021
avatar brianteeman
brianteeman - comment - 3 Aug 2021

// Search if the extension exists in the extensions table. Excluding joomla core extensions (id < 10000) and discovered extensions.

Are you sure that the second part is always true. (excludes discovered extensions)

I just tested one of my sites with lots of discovered extensions and they are all in the extensions and updatesites table

avatar richard67
richard67 - comment - 3 Aug 2021

Are you sure that the second part is always true. (excludes discovered extensions)

I just tested one of my sites with lots of discovered extensions and they are all in the extensions and updatesites table

@brianteeman That's the ->where($db->quoteName('state') . ' != -1'); doing.

If you have discovered an extension but haven't installed yet, there is already created a record in the extensions table, and that has status -1.

avatar richard67
richard67 - comment - 3 Aug 2021

@brianteeman Should I change the and discovered extensions into and discovered but not yet installed extensions?

avatar richard67 richard67 - change - 3 Aug 2021
Labels Added: ?
avatar richard67 richard67 - change - 3 Aug 2021
The description was changed
avatar richard67 richard67 - edited - 3 Aug 2021
avatar brianteeman brianteeman - test_item - 3 Aug 2021 - Tested successfully
avatar brianteeman
brianteeman - comment - 3 Aug 2021

I have tested this item successfully on aa3a03e


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

avatar Quy Quy - test_item - 4 Aug 2021 - Tested successfully
avatar Quy
Quy - comment - 4 Aug 2021

I have tested this item successfully on aa3a03e


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

avatar Quy Quy - change - 4 Aug 2021
Status Pending Ready to Commit
avatar Quy
Quy - comment - 4 Aug 2021

RTC


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

avatar zero-24
zero-24 - comment - 6 Aug 2021

Merging thanks.

avatar zero-24 zero-24 - change - 6 Aug 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-06 18:36:18
Closed_By zero-24
Labels Added: ? ?
Removed: ?
avatar zero-24 zero-24 - close - 6 Aug 2021
avatar zero-24 zero-24 - merge - 6 Aug 2021

Add a Comment

Login with GitHub to post a comment