[Koha-bugs] [Bug 32418] CRASH: Can't call method "unblessed" on an undefined value at cataloguing/additem.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 20 11:04:09 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32418

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #145306|0                           |1
        is obsolete|                            |
 Attachment #145307|0                           |1
        is obsolete|                            |

--- Comment #23 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 145505
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145505&action=edit
Bug 32418 - Can't call method 'unblessed' on an undefined value at
cataloguing/additem.pl

Check whether the current op is edititem or dupeitem and if so check
whether the itemnumber supplied as a query param actually exists.

If it doesn't, redirect to the additem op and hide all UI elements except
for a dialog that gives options to add a new item to the record or to
view the records holdings.

This behaviour was adapted from the addbiblio view, as suggested by
Fridolin.

To test:
1. Go to any record
2. Hit the edit button on an item in the holdings table
3. Modify the URL so that the query param for the itemnumber is either
    3.1 empty:
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=384&itemnumber=
    3.2 an itemnumber that doesn't exist:
     
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=384&itemnumber=9999999999
    3.3 whatever else you come up with..
4. Check the same thing for the dupe option (op=dupeitem)
5. Sign off

Signed-off-by: David Nind <david at davidnind.com>

Bug 32418 - Can't call method 'unblessed' on an undefined value at
cataloguing/additem.pl

Check whether the current op is edititem or dupeitem and if so check
whether the itemnumber supplied as a query param actually exists.

If the item is not defined we output_and_exit and save the time to
execute the rest of the controller code. Additionally we now don't have
to process the whole template anymore.

The only caveat is that we now have the suggested actions above the
actual error message. Still an improvement. though.

Again, thanks Frido. Hope, that this is what you had in mind.

To test:
1. Go to any record
2. Hit the edit button on an item in the holdings table
3. Modify the URL so that the query param for the itemnumber is either
    3.1 empty:
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=384&itemnumber=
    3.2 an itemnumber that doesn't exist:
     
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=384&itemnumber=9999999999
    3.3 whatever else you come up with..
4. Check the same thing for the dupe option (op=dupeitem)
5. Sign off

Signed-off-by: David Nind <david at davidnind.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list