Skip to content

[6.x] Fix update badge showing "0" when using Redis as cache store - #15767

Merged
duncanmcclean merged 1 commit into
6.xfrom
fix/updates-count-redis-string
Nov 2, 2026
Merged

duncanmcclean merged 1 commit into
6.xfrom
fix/updates-count-redis-string

Conversation

@joshuablum

Copy link
Copy Markdown
Member

When the cache store is Redis, the Updates item in the Control Panel nav shows an amber badge with "0" even when there are no updates.

UpdatesOverview caches the update count as an integer. Laravel's RedisStore saves numeric values without serializing them, and reading them back returns strings. So /cp/updater/count responds with {"count": "0", ...}. UpdatesBadge renders with v-if="count", and since "0" is truthy in JavaScript, the badge shows.

The other cached values (statamic, security, addons) aren't affected, because booleans and arrays get serialized and keep their type.

This PR casts the count to an integer in UpdatesOverview::count(). That matches the existing @return int docblock and badge()'s array{count: int, security: bool} shape.

Thanks to Ash for reporting this through support!

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@duncanmcclean
duncanmcclean merged commit f04743d into 6.x Nov 2, 2026
65 checks passed
@duncanmcclean
duncanmcclean deleted the fix/updates-count-redis-string branch November 2, 2026 14:12
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.

2 participants