[Bug 9894] New: de-serialize the 'hidden' value for subfields in frameworks
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Bug ID: 9894 Summary: de-serialize the 'hidden' value for subfields in frameworks Classification: Unclassified Change sponsored?: --- Product: Koha Version: 3.14 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com The 'hidden' value is a serialization of several possible visualizatio combinations (http://manual.koha-community.org/3.8/en/catadmin.html#marcbibframeworks). This way of handling is troublesome for: - The code (difficult to read, difficult to find bugs) - The users (instead of simple checkboxes they need to read the docs, looking for a weird number. Several bugs about this 'hidden' option are related to some math on the 'hidden' value. I propose to change that field for 'vis_opac' |' vis_intranet' | 'vis_editor' | 'collapsed', all of them YesNo values. This will require a lot of rewrite in code like this: next if ( ($sf_def->{hidden}||0) > 0 ); or this: next if ( $tagslib->{ $fields[$x_i]->tag() }->{'@'}->{hidden} =~ /-7|-4|-3|-2|2|3|5|8/); -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I'd like to add that I wrote some serialization/de-serialization javascript functions in the meantime that could fit 3.12, but it depends on the RM right now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 16876 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16876&action=edit Bug 9894 - (3.12) de-serialize the 'hidden' value for subfields in frameworks This patch aims to provide a non-intrusive way (with respect to Koha's code, so it could have got into 3.12) for the users to easily choose the visibility settings for each subfield. This patch is also known to have arrived late for 3.12. I've been struggling with other stuff at work, but I just wanted to put this somewhere just in case it can be reused or something else. The patch adds two JavaScript functions that deal with (de)serialization of the 'hidden' value for subfields. One each way. Listeners are added to the checkboxes so the (actually, heh) 'hidden' value gets correctly updated on each checkbox change. There's a costly function to update all checkboxes on every tab to match the 'hidden' value on page load. To test: - open the docs to have at hand the list of codes/visibility options combinations and try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page. - I had a MySQL shell opened to repeatedly run this query (i tested against field 886 on the default framework): > SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886; - Compare what was saved on the DB with the docs for that visibility selection. Regards To+ PS: I promise I'll work on the proper patch for 3.14, which would involve DB structure changes and (more than I expected) rewriten code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894
Tomás Cohen Arazi <tomascohen@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #16876|0 |1
is obsolete| |
--- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> ---
Created attachment 16877
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16877&action=edit
Bug 9894 - (3.12) de-serialize the 'hidden' value for subfields in frameworks
This patch aims to provide a non-intrusive way (with respect to Koha's code, so
it could have got into 3.12) for the users to easily choose the visibility
settings
for each subfield.
This patch is also known to have arrived late for 3.12. I've been struggling
with
other stuff at work, but I just wanted to put this somewhere just in case it
can
be reused or something else.
The patch adds two JavaScript functions that deal with (de)serialization of the
'hidden'
value for subfields. One each way. Listeners are added to the checkboxes so the
(actually, heh)
'hidden' value gets correctly updated on each checkbox change.
There's a costly function to update all checkboxes on every tab to match the
'hidden' value on page load.
To test:
- open the docs to have at hand the list of codes/visibility options
combinations and
try changing several subfields from a single tagfield. Save, and reopen the
"Edit subfields" page.
- I had a MySQL shell opened to repeatedly run this query (i tested against
field 886
on the default framework):
> SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886;
- Compare what was saved on the DB with the docs for that visibility selection.
Regards
To+
PS: I promise I'll work on the proper patch for 3.14, which would involve DB
structure changes and
(more than I expected) rewriten code.
Sponsored-by: Universidad Nacional de Córdoba
--
You are receiving this mail because:
You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|Medium patch |Small patch Version|3.14 |3.12 Summary|de-serialize the 'hidden' |'hidden' value is hard to |value for subfields in |understand in frameworks |frameworks | Severity|enhancement |normal --- Comment #4 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- The current patch is a reasonable bugfix and therefore could be included in Koha 3.12 if it gets tested and so forth before the string freeze. A broader overhaul for is also needed, but for 3.14 not 3.12. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894
Liz Rea <liz@catalyst.net.nz> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #16877|0 |1
is obsolete| |
--- Comment #5 from Liz Rea <liz@catalyst.net.nz> ---
Created attachment 16878
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16878&action=edit
Bug 9894 - (3.12) de-serialize the 'hidden' value for subfields in frameworks
This patch aims to provide a non-intrusive way (with respect to Koha's code, so
it could have got into 3.12) for the users to easily choose the visibility
settings
for each subfield.
This patch is also known to have arrived late for 3.12. I've been struggling
with
other stuff at work, but I just wanted to put this somewhere just in case it
can
be reused or something else.
The patch adds two JavaScript functions that deal with (de)serialization of the
'hidden'
value for subfields. One each way. Listeners are added to the checkboxes so the
(actually, heh)
'hidden' value gets correctly updated on each checkbox change.
There's a costly function to update all checkboxes on every tab to match the
'hidden' value on page load.
To test:
- open the docs to have at hand the list of codes/visibility options
combinations and
try changing several subfields from a single tagfield. Save, and reopen the
"Edit subfields" page.
- I had a MySQL shell opened to repeatedly run this query (i tested against
field 886
on the default framework):
> SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886;
- Compare what was saved on the DB with the docs for that visibility selection.
Regards
To+
PS: I promise I'll work on the proper patch for 3.14, which would involve DB
structure changes and
(more than I expected) rewriten code.
Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I promise to hug you the next time we meet. This works, and is a reasonable
work around for a very longstanding awkward interface.
--
You are receiving this mail because:
You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA comment: Looks good. But I have 2 questions: 1/ What about the -8 value? 2/ What about "bad values"? Since it is a free field, the value can be anything. Your patch set "5" for these cases, is it intended? Maybe it could be great to update the help page. Please clarify 1 and 2. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |liz@catalyst.net.nz --- Comment #7 from Liz Rea <liz@catalyst.net.nz> --- I've been looking through the documentation, I can't even see what the "Flag" value does - maybe someone out there knows? I have certainly never seen it used in practice anywhere. Regarding number 2, as the help states - there are only 17 implemented view options - putting anything else but one of those (which this patch doesn't allow) is invalid input anyway, and nothing will happen. The original feature was poorly designed, this is a HUGE improvement. I'd be happy to add the condition for flag as a follow up, and update the help pages to get this patch moving. Liz -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #8 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 17019 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17019&action=edit Bug 9894 - Followup: Add support for "flagged" values Even though we don't know what they mean or do. To test: - open the docs to have at hand the list of codes/visibility options combinations and try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page. - Click the "Flagged" checkbox - it should disable the other checkboxes as this setting is (apparently) exclusive to the others. - Step through several tabs and set your visibilities as you like. - I had a MySQL shell opened to repeatedly run this query (i tested against field 886 on the default framework): > SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886; - Compare what was saved on the DB with the docs for that visibility selection. Bug 9894 - Help file updates To test: Click the Help link in the upper right hand corner of the MARC subfield editor Verify that the epic list of values is gone Verify that the help page overall looks alright Verify that the help makes sense and is understandable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 17176 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17176&action=edit Bug 9894 - Followup: Add support for "flagged" values Even though we don't know what they mean or do. To test: - open the docs to have at hand the list of codes/visibility options combinations and try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page. - Click the "Flagged" checkbox - it should disable the other checkboxes as this setting is (apparently) exclusive to the others. - Step through several tabs and set your visibilities as you like. - I had a MySQL shell opened to repeatedly run this query (i tested against field 886 on the default framework): > SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886; - Compare what was saved on the DB with the docs for that visibility selection. Bug 9894 - Help file updates To test: Click the Help link in the upper right hand corner of the MARC subfield editor Verify that the epic list of values is gone Verify that the help page overall looks alright Verify that the help makes sense and is understandable. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17019|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 17177 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17177&action=edit Bug 9894 - (3.12) Small followup Liz's patch adds the 'flagged' value back, but there's a problem with its logic that prevents it to work on startup (works fine for changing values) Regards To+ Sponsored-by: Universidad Nacional de Córdoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 17181 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17181&action=edit Bug 9894: Add labels for checkboxes -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17177|0 |1 is obsolete| | --- Comment #12 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 17259 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17259&action=edit [SIGNED-OFF] Bug 9894 - (3.12) Small followup Liz's patch adds the 'flagged' value back, but there's a problem with its logic that prevents it to work on startup (works fine for changing values) Regards To+ Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17181|0 |1 is obsolete| | --- Comment #13 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 17260 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17260&action=edit [SIGNED-OFF] Bug 9894: Add labels for checkboxes Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact| |jonathan.druart@biblibre.co | |m --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- Great ergonomic improvement. All good to me. Marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894
Jonathan Druart <jonathan.druart@biblibre.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #16878|0 |1
is obsolete| |
Attachment #17176|0 |1
is obsolete| |
Attachment #17259|0 |1
is obsolete| |
Attachment #17260|0 |1
is obsolete| |
--- Comment #15 from Jonathan Druart <jonathan.druart@biblibre.com> ---
Created attachment 17278
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17278&action=edit
Bug 9894 - (3.12) de-serialize the 'hidden' value for subfields in frameworks
This patch aims to provide a non-intrusive way (with respect to Koha's code, so
it could have got into 3.12) for the users to easily choose the visibility
settings
for each subfield.
This patch is also known to have arrived late for 3.12. I've been struggling
with
other stuff at work, but I just wanted to put this somewhere just in case it
can
be reused or something else.
The patch adds two JavaScript functions that deal with (de)serialization of the
'hidden'
value for subfields. One each way. Listeners are added to the checkboxes so the
(actually, heh)
'hidden' value gets correctly updated on each checkbox change.
There's a costly function to update all checkboxes on every tab to match the
'hidden' value on page load.
To test:
- open the docs to have at hand the list of codes/visibility options
combinations and
try changing several subfields from a single tagfield. Save, and reopen the
"Edit subfields" page.
- I had a MySQL shell opened to repeatedly run this query (i tested against
field 886
on the default framework):
> SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886;
- Compare what was saved on the DB with the docs for that visibility selection.
Regards
To+
PS: I promise I'll work on the proper patch for 3.14, which would involve DB
structure changes and
(more than I expected) rewriten code.
Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I promise to hug you the next time we meet. This works, and is a reasonable
work around for a very longstanding awkward interface.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
--
You are receiving this mail because:
You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #16 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 17279 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17279&action=edit Bug 9894 - Followup: Add support for "flagged" values Even though we don't know what they mean or do. To test: - open the docs to have at hand the list of codes/visibility options combinations and try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page. - Click the "Flagged" checkbox - it should disable the other checkboxes as this setting is (apparently) exclusive to the others. - Step through several tabs and set your visibilities as you like. - I had a MySQL shell opened to repeatedly run this query (i tested against field 886 on the default framework): > SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886; - Compare what was saved on the DB with the docs for that visibility selection. Bug 9894 - Help file updates To test: Click the Help link in the upper right hand corner of the MARC subfield editor Verify that the epic list of values is gone Verify that the help page overall looks alright Verify that the help makes sense and is understandable. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #17 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 17280 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17280&action=edit Bug 9894 - (3.12) Small followup Liz's patch adds the 'flagged' value back, but there's a problem with its logic that prevents it to work on startup (works fine for changing values) Regards To+ Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 --- Comment #18 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 17281 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17281&action=edit Bug 9894: Add labels for checkboxes Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9894 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #19 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master and 3.12.x. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org