Problem/Motivation
As per the docs running Rebuild.php script can clear Drupal cache even when Drupal itself does not work. On running it from browser It does clears the cache but as written in the code \Drupal::messenger()->addStatus('Cache rebuild complete.'); of the script it doesn't shows the status message "Cache rebuild complete."
Steps to reproduce
- Add
$settings['rebuild_access'] = TRUE;in your settings.php file. - Browse the url /core/rebuild.php
- It redirects to home page after clearing the cache but doesn’t shows any status message.
Proposed resolution
Either remove the message or handle the redirection with different ways.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
None
Comments
Comment #2
saxenaakansha30Comment #3
saxenaakansha30Comment #4
mohit.bansal623 commented@saxenaakansha30 Redirect response is also not working, so removing the success message will solve the issue ? Please confirm.
Comment #5
spokjeFixing typo in title
Comment #6
saxenaakansha30@mohit.bansal623: If removing the status message is the only option then it will solve the issue. But is there any other way you could think of with which we can still show status message.
Comment #7
mstrelan commentedTested this on 10.1.x and can confirm the issue still exists. One possible solution would be to define a route and controller that simply sets the message and performs the redirect, then rebuild.php can redirect to that route. That seems like overkill though, and I'm sure there is a simpler way.
Comment #8
mstrelan commentedI came across #2940148: Messenger service can't set messages super early and loses reference to flashbag reference on rebuild which sounded related. Re-rolled the patch for that issue and tested this again and it was fixed. Marking as a duplicate of that issue.