Bug 20187 - New rewrite rules can break custom css
Summary: New rewrite rules can break custom css
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on: 12904
Blocks: 20259
  Show dependency treegraph
 
Reported: 2018-02-13 13:20 UTC by Kyle M Hall
Modified: 2018-06-04 20:15 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20187: New rewrite rules can break custom css (3.86 KB, patch)
2018-02-13 13:24 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20187: New rewrite rules can break custom css (3.92 KB, patch)
2018-02-13 13:46 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 20187: Add another KOHA_VERSION in C4/Auth (1009 bytes, patch)
2018-02-13 14:42 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20187: Add another KOHA_VERSION in C4/Auth (1022 bytes, patch)
2018-02-13 14:48 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20187: New rewrite rules can break custom css (4.02 KB, patch)
2018-02-13 14:56 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20187: (QA follow-up) Replace N,L flag by L flag (3.71 KB, patch)
2018-02-13 14:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20187: Fix Tiny MCE (822 bytes, patch)
2018-02-13 15:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20187: (QA follow-up) Replace N,L flag by L flag (3.73 KB, patch)
2018-02-13 15:44 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2018-02-13 13:20:07 UTC
Koha has the ability to include custom css in the apache configuration. If a library has any custom css ( or adds a custom js file in some way ), and that file has an underscore in it ( e.g. my_custom.css ), the apache rewrite rule will convert it to my.css and thus it will 404.

We should make the rewrite rules as specific as possible for the format we are using.
Comment 1 Kyle M Hall 2018-02-13 13:24:04 UTC
Created attachment 71537 [details] [review]
Bug 20187: New rewrite rules can break custom css

Koha has the ability to include custom css in the apache configuration.
If a library has any custom css ( or adds a custom js file in some way ),
and that file has an underscore in it ( e.g. my_custom.css ), the
apache rewrite rule will convert it to my.css and thus it will 404.

We should make the rewrite rules as specific as possible for the
format we are using.

Test Plan:
1) Set OPAC_CSS_OVERRIDE to a file with an underscore in it
2) Note it does not work
3) Apply this patch
4) Update the apache rewrite rules to match those in the patch
   For kohadevbox, just run /home/vagrant/misc4dev/cp_debian_files.pl
5) Restart apache
6) Reload the page, your custom css should load now!
Comment 2 Victor Grousset/tuxayo 2018-02-13 13:46:44 UTC
Created attachment 71538 [details] [review]
Bug 20187: New rewrite rules can break custom css

Koha has the ability to include custom css in the apache configuration.
If a library has any custom css ( or adds a custom js file in some way ),
and that file has an underscore in it ( e.g. my_custom.css ), the
apache rewrite rule will convert it to my.css and thus it will 404.

We should make the rewrite rules as specific as possible for the
format we are using.

Test Plan:
1) Set OPAC_CSS_OVERRIDE to a file with an underscore in it
2) Note it does not work
3) Apply this patch
4) Update the apache rewrite rules to match those in the patch
   For kohadevbox, just run /home/vagrant/misc4dev/cp_debian_files.pl
5) Restart apache
6) Reload the page, your custom css should load now!

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Comment 3 Marcel de Rooy 2018-02-13 14:26:15 UTC
Intranet login fails
Comment 4 Victor Grousset/tuxayo 2018-02-13 14:30:54 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2018-02-13 14:42:56 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2018-02-13 14:48:24 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2018-02-13 14:52:16 UTC
(In reply to Marcel de Rooy from comment #6)
> Created attachment 71542 [details] [review] [review]
> Bug 20187: Add another KOHA_VERSION in C4/Auth
> 
> Needed when logging out and in again..
> 
> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Moved to bug 20189
Comment 8 Marcel de Rooy 2018-02-13 14:56:58 UTC
Created attachment 71544 [details] [review]
Bug 20187: New rewrite rules can break custom css

Koha has the ability to include custom css in the apache configuration.
If a library has any custom css ( or adds a custom js file in some way ),
and that file has an underscore in it ( e.g. my_custom.css ), the
apache rewrite rule will convert it to my.css and thus it will 404.

We should make the rewrite rules as specific as possible for the
format we are using.

Test Plan:
1) Set OPAC_CSS_OVERRIDE to a file with an underscore in it
2) Note it does not work
3) Apply this patch
4) Update the apache rewrite rules to match those in the patch
   For kohadevbox, just run /home/vagrant/misc4dev/cp_debian_files.pl
5) Restart apache
6) Reload the page, your custom css should load now!

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2018-02-13 14:57:02 UTC
Created attachment 71545 [details] [review]
Bug 20187: (QA follow-up) Replace N,L flag by L flag

The flags [N,L] make no sense: next and last combined.
Choosing here for L to stop the rewriting process.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Kyle M Hall 2018-02-13 15:01:22 UTC Comment hidden (obsolete)
Comment 11 Victor Grousset/tuxayo 2018-02-13 15:44:08 UTC
Created attachment 71554 [details] [review]
Bug 20187: (QA follow-up) Replace N,L flag by L flag

The flags [N,L] make no sense: next and last combined.
Choosing here for L to stop the rewriting process.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Comment 12 Jonathan Druart 2018-02-13 16:00:51 UTC
Pushed to master for 18.05, thanks to everybody involved!