Bug 19646: fix value_builder marc21_linking_section template
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 17 Nov 2017 12:38:06 +0000 (13:38 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 7 Dec 2017 12:37:09 +0000 (09:37 -0300)
When using marc21_linking_section cataloging plugin, you get the error :
Template process failed: undef error - The method selected is not
covered by tests! at /home/koha/src/C4/Templates.pm line 122.

It commes from [% IF ( itypeloo.selected ) %], selected is not defined
in itypeloo.

This patch removes this condition because all item types are fetched
from database, there is not one selected. It sets "All item types" as
selected. Also correctes two errors in HTML : ending form and div,
"<a_class=" instead of "<a class="

Test plan :
1) Use a MARC21 database
2) Define marc21_linking_section cataloging plugin in framework, on
   773$t for example
3) Create a new biblio record
4) Click on icon in 773$t
5) Check plugin works fine

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt

index ba214da..63108a0 100644 (file)
                                <input type="text" name="search" id="searchbox" size="35" /><br />
                              <label for="itypeloop">Item type</label>
                                <select name="itype" id="itypeloop">
-                           <option value="">All Item Types</option>
+                           <option value="" selected="selected">All Item Types</option>
                                [% FOREACH itypeloo IN itypeloop %]
-                            [% IF ( itypeloo.selected ) %]
-                         <option value="[% itypeloo.itemtype %]" selected="selected">[% itypeloo.description %]</option>
-                                [% ELSE %]
                              <option value="[% itypeloo.itemtype %]">[% itypeloo.description %]</option>
-                            [% END %]
                               [% END %]
                               </select>
                       </p>
                             <input type="submit" value="Start search" />
                    </p>
 
-          </div>
</form>
+            </form>
       </div>
 
        [% ELSE %]
 
                                     [% IF ( resul.even ) %]<td class="hilighted">
                                     [% ELSE %]<td>[% END %]
                                                             [% IF ( resul.MARC_ON ) %]
-                                                                    <a_class="transparent resultlist" href="/cgi-bin/koha/MARCdetail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title |html %]</a>
+                                                                    <a class="transparent resultlist" href="/cgi-bin/koha/MARCdetail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title |html %]</a>
                                                             [% ELSE %]
-                                                                    <a_class="transparent resultlist" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title |html %]</a>                          [% END %]
+                                                                    <a class="transparent resultlist" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title |html %]</a>                          [% END %]
                                                     <p>[% resul.author %]
                                                     [% IF ( resul.publishercode ) %]- [% resul.publishercode %][% END %]
                                                     [% IF ( resul.place ) %] ; [% resul.place %][% END %]