[Koha-bugs] [Bug 9659] Undefined authorised value category yields empty dropdown menu on SQL reports

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 21 22:23:48 CET 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9659

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15596|0                           |1
        is obsolete|                            |

--- Comment #4 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 15603
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=15603&action=edit
Bug 9659 - Better handling of non-existent authorised value categories used in
SQL reports

A user might create a SQL report that relies on non-existent authorised value
categories.
Because of a typo, or just because they copy&pasted the report from the Wiki.

Use cases are:

- The user creates a report from SQL
  a) Uses bad authorised values
  b) Clicks 'Save Report'
  c) Koha lists the problematic authorised values
  d) The user decides to
  e-1) Save it anyway, it gets saved
  e-2) Edit the report, it gets back to where it chose 'Save Report'

- The user edits an already saved report (Update SQL)
  a) Uses bad authorised values
  b) Clicks 'Update SQL'
  c) Koha lists the problematic authorised values
  d) The user decides to
  e-1) Save it anyway, it gets saved
  e-2) Edit the report, it gets back to where it chose 'Update SQL'

- The user tries to run a saved report that contains bad authorised values,
Koha advertises the problem and provides the user with a button 'Edit SQL' to
fix things.

To test, just create a report from SQL using invalid authorised values like
this (misspelled 'branch'):

SELECT *
FROM itemtypes
WHERE hola=<<Test branch1|branchee>> AND
      hola2=<<Test branch2|brancha>>

Regards
To+

Notes:
- I added several comments on the code.
- Fixed an annoying warning of uninitialised variable also (refactored some
tiny bits to do it).
- Added the following methods
   -  C4::Reports::Guided::GetReservedAuthorisedValues
   -  C4::Reports::Guided::GetParametersFromSQL
   -  C4::Reports::Guided::IsAuthorisedValueValid
   -  C4::Reports::Guided::ValidateSQLParameters
   -  C4::Koha::IsAuthorisedValueCategory
- Those methods could have been used to refactor this guided reports code as
its *a bit messy*. I chose to do it in a new bug of course :-D.
- Fixed some trivial perlcritic -5 errors
- Removed some debugging stuff left by mistake
- Thanks to Owen and Jared for their patience heh.

Sponsored-by: Universidad Nacional de Córdoba

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


More information about the Koha-bugs mailing list