[Bug 21576] New: Add a developer script to automatically fix missing filters
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Bug ID: 21576 Summary: Add a developer script to automatically fix missing filters Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Depends on: 13618 Blocks: 21526 Since bug 13618 developers have to escape TT variables when needed. It is not easy to think about (as we are lazy) and hard to pick the good one (html vs uri). It would be great to help our brains and have a script to add them automagically when needed. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13618 [Bug 13618] Add additional template filter methods and a filter presence test to Koha https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21526 [Bug 21526] TT variables used to build a link should be uri filtered -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80640 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80640&action=edit Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80642 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80642&action=edit Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80642|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80644 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80644&action=edit Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80648 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80648&action=edit Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80644|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80659 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80659&action=edit Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80648|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80660 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80660&action=edit Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80640|0 |1 is obsolete| | Attachment #80659|0 |1 is obsolete| | Attachment #80660|0 |1 is obsolete| | --- Comment #7 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 80671 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80671&action=edit Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 80672 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80672&action=edit Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 80673 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80673&action=edit Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80671|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80694&action=edit Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80672|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80695&action=edit Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80673|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80696 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80696&action=edit Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Awesome work making the devs lives easier Jonathan. Passing QA.. reads well and works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80716 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80716&action=edit Bug 21576: Preserve chomp chars for USE raw See bug 21526 comments 5-7 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80694|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81060 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81060&action=edit Bug 21576: Add a developer script to fix missing TT filters See bug 13618 and bug 21526. We need a script to add missing filters, or replace wrong ones. Test plan: - Add unescaped variables to .tt files - prove xt/find-missing-filters.t will warn about them - perl misc/devel/add_missing_filters.pl will add the missing/wrong filters - prove xt/find-missing-filters.t will now be happy Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80695|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81061 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81061&action=edit Bug 21576: Keep compatibility with QA script The QA script call 'missing_filters', it sounds better to keep it in order to avoid fixing it and have a weird condition (if module->can('subroutine_name')) to maintain Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80696|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81062 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81062&action=edit Bug 21576: Handle complex uri Only the first TT params in a href was taken into account. This also takes care to replace into href attributes only (for instance not title, etc.) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80716|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81063 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81063&action=edit Bug 21576: Preserve chomp chars for USE raw See bug 21526 comments 5-7 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Just given the final followup a quick once over.. still Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #20 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement, will not be backported to 18.05.x series. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- What about <img src=""> here ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I think the are a few improvements that could be made here, but personally I think they should be recorded in follow-up bugs so they don't get lost in the conversion here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Bug 21576 depends on bug 13618, which changed state. Bug 13618 Summary: Add additional template filter methods and a filter presence test to Koha https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13618 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #24 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Resolved ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #22)
What about <img src=""> here ?
Hi Marcel, can you explain what you had in mind? I am not sure I understand. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22466 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22466 [Bug 22466] TT methods must not be escaped -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #26 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #25)
(In reply to Marcel de Rooy from comment #22)
What about <img src=""> here ?
Hi Marcel, can you explain what you had in mind? I am not sure I understand.
I am not sure if I still do too :) Waited too long.. But I guess it is about things like: if ( $line =~ qr{<a href="([^"]+)} ) { Here you handle the URI in the href attribute. Which is good. But I do not see something similar for handling the src attribute of an img tag. Probably that was my question ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Yes Marcel, it's a good idea. But we must catch the other tags as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21576 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38872 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38872 [Bug 38872] Only first 'a' node tested for wrong filters -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org