Skip to content

datatables_view: filter clear icon 404s - bundled CSS points at a path that isn't served #9563

Description

@chriswydra

CKAN version: 2.12.0 (also 2.11.x, 2.10.4 and master)

Describe the bug

Every page with a DataTables view logs a 404 for:

/webassets/ckanext-datatablesview/vendor/FontAwesome/images/times-circle-solid.svg

ckanext/datatablesview/assets/datatables_view.css sets the icon for the search input's cancel button with a relative URL:

input[type="search"]::-webkit-search-cancel-button {
  ...
  background-image: url('vendor/FontAwesome/images/times-circle-solid.svg');
}

The CSS is served as part of the ckanext-datatablesview/main-css webassets bundle (output ckanext-datatablesview/%(version)s_datatablesview.css, no filters), so the relative URL resolves under /webassets/ckanext-datatablesview/, where only the bundle output exists. On 2.10 the SVG is reachable at /vendor/FontAwesome/images/times-circle-solid.svg (the extension's public/ folder), but the bundled CSS never points there; from 2.11 the SVG sits in assets/, which isn't served at all.

The effect is cosmetic: the "x" clear button in the column filter boxes is missing in WebKit/Blink browsers. Filtering still works.

Steps to reproduce

  1. CKAN 2.12 with datatables_view enabled.
  2. Open a resource page with a table preview.
  3. Browser network tab: 404 for times-circle-solid.svg. Type into a column filter box in Chrome - no clear icon.

Expected behaviour

The icon loads and no 404 is logged.

Suggested fix

Inline the SVG as a data URI in datatables_view.css, so the icon doesn't depend on a file being served, and drop the now-unused assets/vendor/FontAwesome/. It's the only reference to that file. I'll open a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions