WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#19441 closed defect (bug) (fixed)

The path of the background icon for the "dismiss" link of WP Pointer is broken

Reported by: jamalorg Owned by: nacin
Milestone: 3.3 Priority: normal
Severity: blocker Version: 3.3
Component: Graphic Design Keywords: dev-reviewed
Focuses: Cc:

Description

The URL of the background icon (x) for the "dismiss" link in WP Pointer returns 404 error because it calls the icon from ../../wp-admin/images/xit.gif.

Logically the path is not wrong. The stylesheet of WP Pointer is located at wp-includes/css/wp-pointer.css, and calling xit.gif path from two directories up is the correct way to do it, but since all admin styles were loaded via wp-admin/load-styles.php the actual path relatively changes.

Change History (8)

comment:1 follow-up: @duck_4 years ago

  • Keywords reporter-feedback added

This must vary in different browsers as I don't get a 404 in Chromium or Firefox. Or maybe it depends on where your WordPress files are, i.e. installed in a subdirectory. What's your setup to reproduce this?

Obviously we cannot just change it to work for load-styles.php because then in would break when SCRIPT_DEBUG == true. In fact it breaks for me with SCRIPT_DEBUG false and the CSS changed to reference ../images/xit.gif (as used by the colors CSS files).

comment:2 in reply to: ↑ 1 ; follow-up: @jamalorg4 years ago

Replying to duck_:

This must vary in different browsers as I don't get a 404 in Chromium or Firefox. Or maybe it depends on where your WordPress files are, i.e. installed in a subdirectory. What's your setup to reproduce this?

It works when WordPress is installed in the root directory (e.g. site.com/), but 404 is returned when WP is installed in sub-directory.

What about dropping a copy of xit.gif icon in wp-includes/images/ and updating the icon URL to this path?

Last edited 4 years ago by jamalorg (previous) (diff)

comment:3 in reply to: ↑ 2 @duck_4 years ago

  • Keywords reporter-feedback removed
  • Milestone changed from Awaiting Review to 3.3

Replying to jamalorg:

It works when WordPress is installed in the root directory (e.g. site.com/), but 404 is returned when WP is installed in sub-directory.

As I suspected. Thanks.

comment:4 @nacin4 years ago

Yeah, I've pointed out elsewhere that we can't do this. xit.gif needs to be copied to wp-includes/images/xit.gif. Then ../images/xit.gif will always work.

comment:5 @nacin4 years ago

We could also add mapping to load-styles.php, but I'd rather not, since the pointers code is designed to hypothetically work on the frontend, and therefore should not rely on admin-only assets (which may be unreachable).

comment:6 @ryan4 years ago

Fine with putting a copy in wp-includes.

comment:7 @nacin4 years ago

  • Keywords dev-reviewed added; needs-ui removed
  • Owner set to nacin
  • Status changed from new to accepted

comment:8 @nacin4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In [19557]:

Copy xit.gif to wp-includes/images for work with pointers CSS. fixes #19441.

Note: See TracTickets for help on using tickets.