WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#3869 closed defect (bug) (worksforme)

WP-DB Error Message -- CSS / image not loading when installed in subdir

Reported by: Viper007Bond Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.1.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

I have WordPress installed in a folder called wordpress, i.e. my files are not in my root.

When I have a database error (for example, when MySQL takes a crap), the page is totally unstyled. 99.9% sure it didn't used to be like this. It's looking for the CSS at wp-admin/install.css rather than wordpress/wp-admin/install.css.

I don't see why it shouldn't be possible to figure out where WordPress is installed relative to the current URL in order to get the stylesheet and image to show up right in most cases.

Attachments (1)

3869.diff (539 bytes) - added by Nazgul 7 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 JeremyVisser7 years ago

Is it possible for this to work based on the value of ABSPATH?

comment:2 markjaquith7 years ago

Same goes for AYS prompts.

I think JeremyVisser is right... we should be able to use ABSPATH and $_SERVER['DOCUMENT_ROOT'] to figure out the siteurl (WP's URL)

comment:3 ryan7 years ago

get_home_path() might he helpful.

comment:4 markjaquith7 years ago

Tricky issue... $_SERVER['DOCUMENT_ROOT'] isn't reliable. Without DB access, there's no surefire way to determine the URL for the WP directory. At least not that I can see.

comment:5 foolswisdom7 years ago

  • Milestone changed from 2.1.3 to 2.2

comment:6 rob1n7 years ago

We could require() the CSS into the <head> element. I believe we still have ABSPATH, so it should be no problem.

comment:8 foolswisdom7 years ago

  • Milestone changed from 2.2 to 2.3

Nazgul7 years ago

comment:9 Nazgul7 years ago

  • Keywords has-patch added; needs-patch removed

Patch (partial?) which fixes this issue if WP_SITEURL is defined attached.

comment:10 Nazgul7 years ago

  • Milestone 2.3 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Assuming fixed, as code now uses wp_die for this functionality.

Feel free to reopen if I'm incorrect.

comment:11 DD327 years ago

Assuming fixed, as code now uses wp_die for this functionality.

Correct; the old die() message hadnt been updated to use the new admin css location.

Note: See TracTickets for help on using tickets.