[Bug 35625] New: Add support for system flag to additional fields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Bug ID: 35625 Summary: Add support for system flag to additional fields Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org Additional fields could be used to extend some multi-use tables by default without needing to extend the initial table. It would be helpful to be able to mark such additional fields with the is_system flag to prevent user deletion. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |35044 Blocks| |32751 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32751 [Bug 32751] [Omnibus] Extend, improve and standardize additional fields https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35044 [Bug 35044] Additional fields: Allow for repeatable fields -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 160171 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160171&action=edit Bug 35625: Add is_system to additional_fields table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 160172 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160172&action=edit Bug 35625: DBIC Schema update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 160173 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160173&action=edit Bug 35625: Update api definition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 160174 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160174&action=edit Bug 35625: Update UI to prevent deletion/edition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 160175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160175&action=edit Bug 35625: Prevent deletion at controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 160176 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160176&action=edit Bug 35625: Add boolean flag to schema -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34324 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34324 [Bug 34324] Merge OPACProblemReport and CatalogConcern functions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Do you have a use case/example maybe? I am a little hesitant because the linked fields are harder to query for libraries and we need to join another table (performance?). Would we need guidelines/agreement about when to use additional fields and when to extend the original tables? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I use it in Bug 34324 - Merge OPACProblemReport and CatalogConcern functions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- The purpose of this table/ft was to add specific data. Flagging a fields as "is mandatory for the system to work correctly" is wrong by design IMO. It should be a column in the original table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #10 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Hey, adding my 2 cents here in what I hope to be a constructive addition. (In reply to Jonathan Druart from comment #9)
The purpose of this table/ft was to add specific data. Flagging a fields as "is mandatory for the system to work correctly" is wrong by design IMO. It should be a column in the original table.
I can definitely see where this argument is coming from, although I don't 100% agree with it being wrong by design. This is still specific data, it's just additional fields that Koha's code will rely on and can't be removed. Some of the alternatives here are: - Add the columns page_url and biblio_id to the ticket table, even though only ticket.source=catalog will use the biblio_id column and only ticket.source=opac_problem will use the page_url, this would get more and more confusing and hard to maintain as we go in the future (i.e. every new single type of ticket will potentially require new niche fields for their own). - Add a new 'tickets_attributes' table (and have this be the 4th relational metadata table we have in Koha, alongside additional_fields, patron_attributes and illrequestattributes. This would allow for a ticket of source=catalog to have the biblio_id and the ticket of source=opac_problem to have the page_url, without adding new columns to the table and making it flexible enough for future ticket types (sources). The problem here is that all this logic already exists in additional_fields. - Have a 'other_stuff' column in the tickets table that would store a json object that could store whatever in it and logic would handle what it wants to retrieve/store depending on the ticket.source (like plugin_data). This is not ideal either. ---- The advantages of having an additional_field:is_system are: - This is_system additional_field will automatically benefit from all the features from additional_fields (it may potentially be an authorized value list, repeatable, searchable, filterable, and so on) AND it would not pollute the tickets table (or any other table that would need to make use of this) with niche fields only used by some instantiations of the table, and not others. - Existing code from additional_fields is reused, thus any future fixes and enhancements also benefit this is_system additional_field. Whereas in any of the alternatives above if you need a specific field to be searchable on the datatable for example you will need to update the data table code. By using the additional_fields with is_system, the programmer just needs to set the field as searchable and nothing else needs to be done, again, benefiting from the additional_fields native features. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Then maybe you need 2 different DB tables. One perl module (generic ticket) that will be inherited by the two specific ticket modules. It's not a bad thing to have different DB tables when your objects are different. Then if you need repeatable fields, you create yet another table with 1-n relationship. It's... relational models and database normalization ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #12 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #11)
Then maybe you need 2 different DB tables.
One perl module (generic ticket) that will be inherited by the two specific ticket modules.
It's not a bad thing to have different DB tables when your objects are different. Then if you need repeatable fields, you create yet another table with 1-n relationship. It's... relational models and database normalization ;)
Yes but you're highlighting exactly why this approach is worth considering in the first place. Why re-implement anything that's already been implemented at the additional_fields level? We already have patron_custom_attributes and additional_fields, 2 implementations of what is essentially the same thing, but now need to be maintained and supported individually. This is exactly what we're aiming to prevent here: implement yet another redundant metadata table that needs to do something that's already implemented in Koha. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Then maybe this needs to be abstracted, to make it more flexible. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- So this feels no like we are trying to implement something like inheritance in the database. We have a "base" ticket table and we have an additional table for any specifics. I think I get the idea now. The idea is very similar to the illrequestattributes, more than to the patron_attributes. The patron_attributes implement limited functionality for workflows, while the illrequestattributes are the data storage for any additional data a backend might need to function properly. At the moment I believe we are thinking to unify the functionality of: * OPAC problem reports * Catalog concerns * <a third thing I don't manage to remember right now> As always there is pros and cons to everything. The problems I see with additional attributes in their key/value form are: * No FK constraints on database level. * No proper datatypes. We store everything as a varchar. This can complicate validation and reporting. * Ease of writing reports with all columns (libraries have repeatedly told me they find it hard) I think there is a use case here... but I am not totally persuaded yet that it's strong enough for the examples given. For the reasons mentioned above, I feel like at least biblio_id might be better off as a column allowing for FK etc. and easy joining with other tables. And logging it could be of some use for the problem reports too (a lot of opac-pages are "biblio record" based (detail, isbd, marc, request, article_request ...) and logging it could allow for interesting reporting) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #15 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Thanks for the input Katrin, these are fair points.
* No FK constraints on database level. I'm not sure what the relevant disadvantages of this apply here. Possibility for stuff like child rows without corresponding parent rows for example, this can (and should) be prevented by being enforced through code at the application level.
* No proper datatypes. We store everything as a varchar. This can complicate validation and reporting. Datatypes (and validation) is another thing we should handle at application level imo for these use cases (related metadata tables). When adding a new additional_field/patron_attribute_type the user should also be able to specify its data type (text, number, currency, date, av_list, relationship, etc). This will require a overhaul to patron_attribute_types, yes, but an overhaul is already required anyway (merging additional_fields and patron_attribute_types).
* Ease of writing reports with all columns (libraries have repeatedly told me they find it hard) It's already the case for additional_fields and patron_attribute_types, we're not introducing a new pattern in terms of ease (or lack thereof) of writing reports. This could possibly be mitigated by having a few more examples in the wiki people can copy off from?
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov, | |m.de.rooy@rijksmuseum.nl, | |nick@bywatersolutions.com, | |tomascohen@gmail.com --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I don't want this sitting for too long without a decision/solution to not block the depending development, but I'd really like to get some more eyes/brains on it. Adding some more in CC, please feel free to also ask on IRC/mailing list/IRC meeting as you see fit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Mark Hofstetter <koha@trust-box.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@trust-box.at -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160171|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173567&action=edit Bug 35625: Add is_system to additional_fields table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160173|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173568 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173568&action=edit Bug 35625: Update api definition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160174|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173569 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173569&action=edit Bug 35625: Update UI to prevent deletion/edition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160175|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173570 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173570&action=edit Bug 35625: Prevent deletion at controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160176|0 |1 is obsolete| | --- Comment #21 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173571&action=edit Bug 35625: Add boolean flag to schema -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Just a rebase to get the rest of the tree working again -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173567|0 |1 is obsolete| | --- Comment #23 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173573&action=edit Bug 35625: Add is_system to additional_fields table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160172|0 |1 is obsolete| | --- Comment #24 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173574&action=edit Bug 35625: DBIC Schema update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173568|0 |1 is obsolete| | --- Comment #25 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173575&action=edit Bug 35625: Update api definition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173569|0 |1 is obsolete| | --- Comment #26 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173576&action=edit Bug 35625: Update UI to prevent deletion/edition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173570|0 |1 is obsolete| | --- Comment #27 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173577&action=edit Bug 35625: Prevent deletion at controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173571|0 |1 is obsolete| | --- Comment #28 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173578&action=edit Bug 35625: Add boolean flag to schema -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m --- Comment #29 from Lisette Scheer <lisette@bywatersolutions.com> --- Do you have a test plan for this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 --- Comment #30 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Afraid not really.. it was for subsequent work but as there was a general push against it I stopped and had to focus on other things. I might get back to it one day. . . -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Laura.escamilla@bywatersolu | |tions.com Status|Needs Signoff |Failed QA --- Comment #31 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Switching this over to Failed QA for now. When you have a test plan ready to go please let me know and I'd be happy to test this! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35625 Bug 35625 depends on bug 35044, which changed state. Bug 35044 Summary: Additional fields: Allow for repeatable fields https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35044 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org