Skip to content

fix(packages): show Package Up to Date instead of Error modal - #17000

Open
Ibochkarev wants to merge 1 commit into
modxcms:3.xfrom
Ibochkarev:fix/14824-check-updates-error-title
Open

fix(packages): show Package Up to Date instead of Error modal#17000
Ibochkarev wants to merge 1 commit into
modxcms:3.xfrom
Ibochkarev:fix/14824-check-updates-error-title

Conversation

@Ibochkarev

Copy link
Copy Markdown
Collaborator

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/CheckForUpdates returned failure() for that case, and MODx.Ajax always follows a failure listener with MODx.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) returns success with the existing package_err_uptodate message and an empty object list. The packages grid treats that empty list as an info alert titled Package Up to Date. Real processor failures still use a minimal failure listener so errorJSON can show the Error dialog once.

How to test

  1. In the manager, open Extras → Installer.
  2. On an installed Extra that has no newer version from its provider, choose Check for Updates.
  3. You should see a dialog titled Package Up to Date with the up-to-date message, not Error.
  4. Repeat on an Extra that does have an update: the update window should still open as before.
  5. Optional: force a provider/package-not-found failure and confirm a single Error dialog still appears.
php -l core/src/Revolution/Processors/Workspace/Packages/CheckForUpdates.php
# exit 0

core/vendor/bin/phpcs --standard=phpcs.xml \
  core/src/Revolution/Processors/Workspace/Packages/CheckForUpdates.php \
  _build/test/Tests/Processors/Workspace/Packages/CheckForUpdatesTest.php
# exit 0

core/vendor/bin/phpunit -c _build/test/phpunit.xml --filter CheckForUpdatesTest
# exit 0 (3 tests, 10 assertions)

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_uptodate added in-repo; other locales via Crowdin.

Breaking change assessment

Connector clients that treated “already up to date” as success: false will now see success: 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 empty latest() 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/errorJSON path against the #14824 repro and ran the Gate E commands above before opening the PR.

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.
@Ibochkarev Ibochkarev self-assigned this Aug 17, 2026
@Ibochkarev Ibochkarev added bug The issue in the code or project, which should be addressed. area-packages Issues, related to package management and workspaces labels Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-packages Issues, related to package management and workspaces bug The issue in the code or project, which should be addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Check for Updates' Modal Window is Titled as 'Error' When No New Updates are Available

1 participant