Bugzilla – Attachment 80642 Details for
Bug 21576
Add a developer script to automatically fix missing filters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21576: Keep compatibility with QA script
Bug-21576-Keep-compatibility-with-QA-script.patch (text/plain), 4.08 KB, created by
Jonathan Druart
on 2018-10-15 20:35:55 UTC
(
hide
)
Description:
Bug 21576: Keep compatibility with QA script
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-10-15 20:35:55 UTC
Size:
4.08 KB
patch
obsolete
>From a021e17e01b4bc48f7f6342624fdd25733e1a2be Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 15 Oct 2018 17:29:35 -0300 >Subject: [PATCH] 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 >--- > t/lib/QA/TemplateFilters.pm | 8 ++++---- > t/template_filters.t | 10 +++++----- > xt/find-missing-filters.t | 2 +- > 3 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/t/lib/QA/TemplateFilters.pm b/t/lib/QA/TemplateFilters.pm >index 400de8bf70..8e817ce013 100644 >--- a/t/lib/QA/TemplateFilters.pm >+++ b/t/lib/QA/TemplateFilters.pm >@@ -30,8 +30,8 @@ sub fix_filters { > return _process_tt_content( @_ )->{new_content}; > } > >-sub search_missing_filters { >- return _process_tt_content( @_ )->{errors}; >+sub missing_filters { >+ return @{_process_tt_content( @_ )->{errors}}; > > } > >@@ -216,7 +216,7 @@ t::lib::QA::TemplateFilters - Module used by tests and QA script to catch missin > > my $content = read_file($filename); > my $new_content = t::lib::QA::TemplateFilters::fix_filters($content); >- my $errors = t::lib::QA::TemplateFilters::search_missing_filters($content); >+ my $errors = t::lib::QA::TemplateFilters::missing_filters($content); > > =head1 DESCRIPTION > >@@ -231,7 +231,7 @@ and to not duplicate the code. > the correct (guessed) filters. > It will also add the [% USE raw %] statement if it is needed. > >-=head2 search_missing_filters >+=head2 missing_filters > > Take a template content file in parameter and return an arrayref of errors. > >diff --git a/t/template_filters.t b/t/template_filters.t >index 3c9c5a97a3..d1cef8d20a 100644 >--- a/t/template_filters.t >+++ b/t/template_filters.t >@@ -33,7 +33,7 @@ EXPECTED > > my $new_content = t::lib::QA::TemplateFilters::fix_filters($input); > is( $new_content . "\n", $expected, ); >- my $missing_filters = t::lib::QA::TemplateFilters::search_missing_filters($input); >+ my $missing_filters = t::lib::QA::TemplateFilters::missing_filters($input); > is_deeply( > $missing_filters, > [ >@@ -79,7 +79,7 @@ EXPECTED > > my $new_content = t::lib::QA::TemplateFilters::fix_filters($input); > is( $new_content . "\n", $expected, ); >- my $missing_filters = t::lib::QA::TemplateFilters::search_missing_filters($input); >+ my $missing_filters = t::lib::QA::TemplateFilters::missing_filters($input); > is_deeply( > $missing_filters, > [{ >@@ -163,7 +163,7 @@ EXPECTED > > my $new_content = t::lib::QA::TemplateFilters::fix_filters($input); > is( $new_content . "\n", $expected, ); >- my $missing_filters = t::lib::QA::TemplateFilters::search_missing_filters($input); >+ my $missing_filters = t::lib::QA::TemplateFilters::missing_filters($input); > is_deeply( > $missing_filters,[],); > }; >@@ -228,7 +228,7 @@ EXPECTED > $input = <<INPUT; > <a href="[% wrong_filter | html %]">[% var | html %]</a> > INPUT >- my $missing_filters = t::lib::QA::TemplateFilters::search_missing_filters($input); >+ my $missing_filters = t::lib::QA::TemplateFilters::missing_filters($input); > is_deeply( > $missing_filters, > [ >@@ -245,6 +245,6 @@ INPUT > $input = <<INPUT; > <a href="[% good_raw_filter | \$raw %]">[% var | html %]</a> > INPUT >- $missing_filters = t::lib::QA::TemplateFilters::search_missing_filters($input); >+ $missing_filters = t::lib::QA::TemplateFilters::missing_filters($input); > is_deeply( $missing_filters, [], ); > }; >diff --git a/xt/find-missing-filters.t b/xt/find-missing-filters.t >index 858c8362f2..a6e731704e 100755 >--- a/xt/find-missing-filters.t >+++ b/xt/find-missing-filters.t >@@ -52,7 +52,7 @@ find({ wanted => \&wanted, no_chdir => 1 }, @themes ); > my @errors; > for my $file ( @files ) { > my $content = read_file($file); >- my $e = t::lib::QA::TemplateFilters::search_missing_filters($content); >+ my $e = t::lib::QA::TemplateFilters::missing_filters($content); > push @errors, { file => $file, errors => $e } if @$e; > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21576
:
80640
|
80642
|
80644
|
80648
|
80659
|
80660
|
80671
|
80672
|
80673
|
80694
|
80695
|
80696
|
80716
|
81060
|
81061
|
81062
|
81063