Bug 15061: Can't add item to rotating collection
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tue, 3 Nov 2015 15:16:08 +0000 (12:16 -0300)
committerLiz Rea <wizzyrea@gmail.com>
Wed, 9 Dec 2015 22:00:02 +0000 (11:00 +1300)
This patch prevents adding items to invalid (empty)
rotating collection id

To test:
1) Go to /cgi-bin/koha/rotating_collections/addItems.pl
2) Try to add an item, you get error show in attached pictures
3) Apply the patch
4) Go again to /cgi-bin/koha/rotating_collections/addItems.pl
5) Can't add any items

I don't know if this is a real problem

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fff73a73837d577214fa3a9198fa97f8a50471f3)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a6878413151477d87955c1af30994dfa5415d180)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>

koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt

index 6e9e725..fa81cf7 100644 (file)
         <div id="yui-main">
             <div class="yui-b">
 
+              [% IF ( ! colId ) %]
+                <div class="dialog message">
+                    <p>Invalid collection id</p>
+                    <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
+                </div>
+              [% ELSE %]
               [% INCLUDE 'rotating-collections-toolbar.inc' %]
-
               <h1>Collection <i>[% colTitle %]</i></h1>
 
               [% IF ( previousActionAdd ) %]
                   <div class="dialog message">There are no items in this collection.</div>
                 [% END %]
               </div>
-
+            [% END %]
             </div> <!-- /.yui-b -->
         </div> <!-- /#yui-main -->
         <div class="yui-b">
             [% INCLUDE 'tools-menu.inc' %]
         </div>
     </div> <!-- /#bd -->
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' %]