Skip to content

[6.x] Fix update status fallback, late icon set callbacks and entry status columns - #20801

Open
riasvdv wants to merge 3 commits into
6.xfrom
rias/small-state-fixes
Open

riasvdv wants to merge 3 commits into
6.xfrom
rias/small-state-fixes

Conversation

@riasvdv

@riasvdv riasvdv commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Description

 Update::fromArray()
-  status = UpdateStatus::tryFrom($status)            // null -> TypeError
+  status = UpdateStatus::tryFrom($status) ?? ELIGIBLE  // 5.x's default
 IconSets::getIconSets()
-  run deferred callbacks on the first read only
+  run whatever is still deferred on each read
 UpdateStatusesCommand
-  where('status'), whereNull('expiryDate')
+  where('entries.status'), whereNull('entries.expiryDate')  // as in 5.x

Evidence

  • Before: an unknown or missing update status from the API threw a TypeError. IconSets::defer() after the first read never ran.
    After: UpdateTest and IconSetsTest cover both, and fail on the old code. UpdateStatusesCommandTest passes.

riasvdv and others added 3 commits November 17, 2026 15:08
The status and expiryDate conditions were unqualified, while 5.x used
entries.status and entries.expiryDate. No joined table has those columns
today, but a plugin's join could make them ambiguous.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
Update::fromArray() passed UpdateStatus::tryFrom() straight into a
non-nullable property, so an unknown or missing status from the API
threw a TypeError. It now falls back to eligible, as 5.x's default did.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
IconSets::defer() callbacks registered after getIconSets() had been
called once were never run. Each read now runs whatever is still pending.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
@github-actions

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

This branch has not been deployed

No deployments
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.

1 participant