User tests: Successful: Unsuccessful:
Pull Request for Issue #16690
Clear Application messageQueue before redirections to get rid of previous messages like "Error loading component: , Component not found."
Current staging with testing datas. Issue reproduceable with J! 3.7.2 and earlier.
"Activate" .htaccess.
Joomla configuration: Set "Use URL Rewriting": YES
Activate plugin "System - Redirect" with option "Collect URLs" = YES.
FE: open item "Main Menu" > "Sample Sites" (example.org/sample-sites). Keep opened.
BE: In Menu Manager open item "Sample Sites" of menu "Main Menu".
Change "Menu Item Type": "Menu Heading". Save.
Reload FE page. 404 error page. Keep opened.
Have a look on the message: "Error loading component: , Component not found." and keep in mind.
BE: Components > Redirect.
Redirect collected 404 (example.org/sample-sites) to e.g. example.org/parks-home.
Reload FE page.
Redirection works "correctly" BUT message:
Warning: Error loading component: , Component not found.
This message comes from the application message queue (compare with above one) that has not been cleared before redirect.
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Labels |
Added:
?
|
At that point old messages aren't relevant anyhow, I think. We are redirecting from a "dead page" to a new page that will collect messages again if necessary.
Wouldn't it make more sense to prevent the error message in the first place? Eg find out why this happens?
"Hiding" messages usually is a sign that something is fishy elsewhere.
It happens because a menuitem type "Menu Header" has no link (= no component, no option=x). Joomla tries to find an empty component and closes with a 404 and collects the message.
At that point old messages aren't relevant anyhow, I think. We are redirecting from a "dead page" to a new page that will collect messages again if necessary.
The single message you're wanting to hide may not be relevant. But through plugins or other happenings, it is entirely possible for other messages to get queued through whatever request chain happens before they get displayed. So we really should avoid just clearing the entire queue because of one message we want to not display.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-16 19:42:12 |
Closed_By | ⇒ | bertmert |
Something doesn't feel right about this pull request. I get what the aim is, but I don't think this is a good fix as you're nuking all queued messages.