Skip to content
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

[4.0] Correctly handle multiple critical extensions within an package that is joomla 4 compatible #34971

Merged
merged 4 commits into from
Jul 30, 2021

Conversation

richard67
Copy link
Member

@richard67 richard67 commented Jul 29, 2021

Pull Request for Issue #34968 .

Summary of Changes

Port PR #34776 to the 4.0-dev branch.

Testing Instructions

  1. Install latest akeeba, enable the system plugin (backup on update) and the action log plugin.
  2. Point your update server to the Joomla 4 nightlies (custom URL: https://update.joomla.org/core/nightlies/next_major_list.xml) in order to get the pre-update checker shown.
  3. Apply this PR
  4. Clear the browser / JS cache.

Actual result BEFORE applying this Pull Request

The pre upgrade checker shows a message about potentially not compatible plugins within that package.

Expected result AFTER applying this Pull Request

The pre update checker shows no message about that plugins cause they are compatible..

Documentation Changes Required

None.

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.0-dev labels Jul 29, 2021
@dgrammatiko
Copy link
Contributor

@richard67 you can filter the array:

if (extensionData.compatibilityData.resultGroup === 3) {
  PreUpdateChecker.nonCoreCriticalPlugins = PreUpdateChecker.nonCoreCriticalPlugins
    .filter((plugin) => plugin.package_id === extensionId || plugin.extension_id === extensionId);
}

@richard67
Copy link
Member Author

@richard67 you can filter the array:

if (extensionData.compatibilityData.resultGroup === 3) {
  PreUpdateChecker.nonCoreCriticalPlugins = PreUpdateChecker.nonCoreCriticalPlugins
    .filter((plugin) => plugin.package_id === extensionId || plugin.extension_id === extensionId);
}

I should invert the condition, I think, because the old code removed elements from the array if matching that condition.

@richard67 richard67 changed the title [4.0] [WiP] Correctly handle multiple critical extensions within an package that is joomla 4 compatible [4.0] Correctly handle multiple critical extensions within an package that is joomla 4 compatible Jul 29, 2021
@richard67 richard67 marked this pull request as ready for review July 29, 2021 13:26
@richard67
Copy link
Member Author

Setting release blocker as inherited from the issue.

@joomdonation
Copy link
Contributor

I should invert the condition, I think, because the old code removed elements from the array if matching that condition.

I think the original code suggested by @dgrammatiko is correct. Filter will remove element from array when condition match, so we should not invert the condition. Could you please check that?

@richard67
Copy link
Member Author

@joomdonation
Copy link
Contributor

@richard67 Sorry, my bad.

@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on 509a356


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

@hans2103
Copy link
Contributor

BEFORE

local joomla4 nl_administrator_index php_option=com_joomlaupdate (3)

AFTER

local joomla4 nl_administrator_index php_option=com_joomlaupdate (2)

@hans2103
Copy link
Contributor

I have tested this item ✅ successfully on 509a356


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

@richard67
Copy link
Member Author

RTC


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

@richard67 richard67 added this to the Joomla 4.0 milestone Jul 29, 2021
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 29, 2021
@Kostelano
Copy link
Contributor

@hans2103 Sorry for the offtopic. Can you please tell me how to get such a page? Which update server should I use? Thanks in advance.

@richard67
Copy link
Member Author

@Kostelano

  • Point your update server to the Joomla 4 nightlies (custom URL: https://update.joomla.org/core/nightlies/next_major_list.xml) in order to get the pre-update checker shown.

  • In case if you are on a current 4.0-dev branch or latest nightly so your version is already 4.0-rc6-dev, edit file libraries/src/Version.php and change const EXTRA_VERSION = 'rc6-dev'; to const EXTRA_VERSION = 'rc6-dev';. Then reload the page and use again the button to check for updates, and then the pre-update check should be shown.

@wilsonge wilsonge merged commit 3af749c into joomla:4.0-dev Jul 30, 2021
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 30, 2021
@richard67 richard67 deleted the 4.0-dev-pre-update-js branch July 30, 2021 07:20
@richard67
Copy link
Member Author

Thanks all - testers, merger, and @dgrammatiko for the idea to use array.filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPM Resource Changed This Pull Request can't be tested by Patchtester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants