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

damiankloip’s picture

the rebuild path in there is not right, as it's actually in core/rebuild.php, not at the top-level in rebuild.php

Nope, same as update.php, .htaccess has a rewrite condition going to core/rebuild.php. Did you test this? The link is not broken.

... is in English only

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.

Put at least basic information into that index.php message instead of pointing people to a drupal.org page.

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.

jhodgdon’s picture

Ah. 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.

radimklaska’s picture

.htaccess has a rewrite condition going to core/rebuild.php

Hi, 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)

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Status: Active » Closed (outdated)
Issue tags: +Bug Smash Initiative

The 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.