#32804 closed defect (bug) (fixed)
Dashboard feeds when switching language
Reported by: | andg | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Administration | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
This might not be the most relevant thing to cover, since language selection is now done at the beginning of the installation process, but when you switch from one language to another, dashboard News feeds should be refreshed in order to show localized content, and allow for the translation of the "Popular Plugin" string, without waiting for the transient to expire.
Attachments (2)
Change History (14)
#1
@
9 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
@
9 years ago
That makes sense, as the feeds cached with the old key would automatically be updated with the new one with the new key, without the user noticing.
#3
@
9 years ago
- Component changed from Feeds to Administration
- Milestone changed from Future Release to 4.3
- Version changed from 4.2.2 to 2.5
#4
@
9 years ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 33183:
#5
@
9 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
As the maximum length of an expiring transient name is 45 characters, this will cause issue for any site which has their locale set to anything longer than 8 characters (45 - 5 (dash_) - 32 (md5) = 8)
Although most locale's are 5~6 characters max, there's things like de_DE_formal
and 58 other locale variants that are showing up in the WordPress.org stats which are longer than 8 characters.
#6
@
9 years ago
Thanks @dd32. So, this solution ain't gonna work. Perhaps we could simply leave the transient name as it is right now, track when language switching happens and manually trigger a Dashboard feed refresh by deleting that transient. Is that possible?
@
9 years ago
This is a new version of the patch with the solution proposed by @ocean90 to include the locale inside the md5 call.
Hello andg, welcome to Trac!
Thanks for your valid report.
The feed gets cached in
wp_dashboard_cached_rss_widget()
The current cache key inwp_dashboard_cached_rss_widget()
is'dash_' . md5( $widget_id )
. I think we should change the cache key to include the current locale.For the credits we're using
'wordpress_credits_' . $locale
so we could change the key to'dash_' . md5( $widget_id ) . '_' . $locale
.