fix(packages): show Package Up to Date instead of Error modal - #17000
Open
Ibochkarev wants to merge 1 commit into
Open
fix(packages): show Package Up to Date instead of Error modal#17000Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
Check for Updates treated an already-current Extra as a processor failure, so MODx.Ajax also opened the generic Error dialog. Return success with an empty update list and a positive title instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
In Package Manager, Check for Updates on an Extra that already has the latest version opened a modal titled Error.
Workspace/Packages/CheckForUpdatesreturnedfailure()for that case, andMODx.Ajaxalways follows a failure listener withMODx.form.Handler.errorJSON, which hard-codes the_('error')title.I changed the processor so “already up to date” (no provider, or provider with an empty
latest()list) returnssuccesswith the existingpackage_err_uptodatemessage and an empty object list. The packages grid treats that empty list as an info alert titledPackage Up to Date. Real processor failures still use a minimalfailurelistener soerrorJSONcan show the Error dialog once.How to test
Related issue(s)/PR(s)
Resolves #14824
Compatibility notes
Manager Package Management UI and the CheckForUpdates connector response. PHP 8.1+. English lexicon key
package_uptodateadded in-repo; other locales via Crowdin.Breaking change assessment
Connector clients that treated “already up to date” as
success: falsewill now seesuccess: true,object: [], and the up-to-date message. The manager grid is updated for that contract. Safe for a patch release for the manager path; note the response-shape change if any custom tooling called this processor directly.Test coverage
_build/test/Tests/Processors/Workspace/Packages/CheckForUpdatesTest.php— missing package fails; package with no provider succeeds as up to date; stub provider with emptylatest()succeeds as up to date. Registered under the Processors suite in_build/test/phpunit.xml.Contributors
@sjmclean24 reported the original repro.
AI tool use
Cursor (Composer) drafted the processor/JS change, focused PHPUnit cases, and this PR body. I checked the MODx.Ajax failure/
errorJSONpath against the #14824 repro and ran the Gate E commands above before opening the PR.