Problem/Motivation
As a follow-up to #2097189: Add a rebuild script (I was going to reopen that issue but instead am opening a new issue as requested)...
Currently if you visit index.php and your site is all screwed up and can't be bootstrapped, you get the following code executed from the index.php file:
catch (Exception $e) {
$message = 'If you have just changed code (for example deployed a new module or moved an existing one) read <a href="http://drupal.org/documentation/rebuild">http://drupal.org/documentation/rebuild</a>';
if (settings()->get('rebuild_access', FALSE)) {
$rebuild_path = $GLOBALS['base_url'] . '/rebuild.php';
$message .= " or run the <a href=\"$rebuild_path\">rebuild script</a>";
}
print $message;
throw $e;
}
This points you to a drupal.org page (with incidentally an outdated http instead of https URL). Which is not good, as you may not even have an internet connection open, and the page you get to is in English only. And then if you don't have the rebuild_access setting set to TRUE, it doesn't even tell you about the possibility that the nice shiny new rebuild.php script could help you. And even if you did have the rebuild_access setting at TRUE, the rebuild path in there is not right, as it's actually in core/rebuild.php, not at the top-level in rebuild.php.
So this is nearly useless, not to mention wrong.
Proposed resolution
a) Put at least basic information into that index.php message instead of pointing people to a drupal.org page.
b) Make sure the information about the rebuild.php script is visible whether or not you have that setting TRUE, and it should tell you which setting to set to TRUE to be able to use rebuild.php.
c) Fix the link to rebuild.php so it points to core/rebuild.php.
Remaining tasks
Patch to fix the issues.
User interface changes
Better index.php behavior if your site is broken.
API changes
None.
Comments
Comment #1
damiankloip commentedNope, same as update.php, .htaccess has a rewrite condition going to core/rebuild.php. Did you test this? The link is not broken.
As mentioned in the other issue, this is an exception message. You won't have access to the translation manager if the container does not work.
As also mentioned, this was already there, and is also useful (IMO). But this is not a symptom of us adding a rebuild script, so you can't blame everything on that issue i'm afraid :). I think supplementing this link with more info is the way to go.
Comment #2
jhodgdonAh. The link did not work for me because I am using a modified .htaccess file -- the one that ships with Drupal does not work for me. Ever. I always have to modify it. So I didn't get that change. I should probably file an issue on the .htaccess file but it has never worked for me with my current Apache setup on my local machine. Long story.
And sorry if I was blaming everything on adding a rebuild script. But let's still fix the other issues.
Comment #3
radimklaskaHi, what about Nginx? It ignores .htaccess files... Is there a reason why we can't link rebuild.php and update.php directly?
(Nginx is listed as one of recommended web servers: #1839336: Add Nginx to INSTALL.txt and recommend it alongside Apache)
Comment #14
quietone commentedThe block of code in question was moved to DrupalKernel.php in #2389811: Move all the logic out of index.php (again) and then removed in #2521852: Make it possible to use your own exception handler without replacement. See #2521852-10: Make it possible to use your own exception handler.
Therefor closing as outdated.