[Bug 10480] New: Cataloging plugins without redefining
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Bug ID: 10480 Summary: Cataloging plugins without redefining Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: m.de.rooy@rijksmuseum.nl Reporter: m.de.rooy@rijksmuseum.nl CC: m.de.rooy@rijksmuseum.nl
From bug 9921, Galen: All the more reason to stick to our coding guidelines, if the additional warning messages in the log annoys somebody enough to inspire them to fix that issue with the cataloging plugins, then. :)
I am submitting a proposal here. May not be perfect yet, but we loose the redefines. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #1 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 19064 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19064&action=edit Bug 10480: New cataloging plugin style without redefining This reports adds the way we handle cataloging plugins. Currently, three functions are redefined: plugin_parameters, plugin_javascript and plugin. In this new proposal, communication between addbiblio and the plugin goes via a global variable. The plugin script detects that way if we are building the plugin or executing it. A example plugin is added just to illustrate the concept. Plugin marc21_leader.pl is adjusted to the new style (plus some cosmetic changes: removing tabs etc.) Test plan: Run the MARC editor and test your current plugins. If you use marc21_leader, test it again. Temporarily connect new_example_plugin to some field and test that. Check the log for warnings about redefines. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #2 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- adds the way => changes the way -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19064|0 |1 is obsolete| | --- Comment #3 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 19072 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19072&action=edit Bug 10480: New cataloging plugin style without redefining This reports adds the way we handle cataloging plugins. Currently, three functions are redefined: plugin_parameters, plugin_javascript and plugin. In this new proposal, communication between addbiblio and the plugin goes via a global variable. The plugin script detects that way if we are building the plugin or executing it. A example plugin is added just to illustrate the concept. Plugin marc21_leader.pl is adjusted to the new style (plus some cosmetic changes: removing tabs etc.) Test plan: Run the MARC editor and test your current plugins. If you use marc21_leader, test it again. Temporarily connect new_example_plugin to some field and test that. Check the log for warnings about redefines. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Nuño López Ansótegui <nunyo@masmedios.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19072|0 |1 is obsolete| | Status|Needs Signoff |Signed Off Assignee|m.de.rooy@rijksmuseum.nl |nunyo@masmedios.com --- Comment #4 from Nuño López Ansótegui <nunyo@masmedios.com> --- Created attachment 19098 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19098&action=edit Bug 10462: Some optimizations in Z3950 search paving the way for enhancements It works fine. ;) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19098|Bug 10462: Some |[SIGNED-OFF] Bug 10480: New description|optimizations in Z3950 |cataloging plugin style |search paving the way for |without redefining |enhancements | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> 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=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19098|0 |1 is obsolete| | --- Comment #5 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 19152 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19152&action=edit Bug 10480: New cataloging plugin style without redefining This reports adds the way we handle cataloging plugins. Currently, three functions are redefined: plugin_parameters, plugin_javascript and plugin. In this new proposal, communication between addbiblio and the plugin goes via a global variable. The plugin script detects that way if we are building the plugin or executing it. A example plugin is added just to illustrate the concept. Plugin marc21_leader.pl is adjusted to the new style (plus some cosmetic changes: removing tabs etc.) Test plan: Run the MARC editor and test your current plugins. If you use marc21_leader, test it again. Temporarily connect new_example_plugin to some field and test that. Check the log for warnings about redefines. Signed-off-by: Nuño López Ansótegui <nunyo@masmedios.com> Still amended this patch: arrayref $building_plugins => hashref $building_plugin hash entry names: tabno and subfieldid are slightly better slightly adjusted test on passed hash values Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |9921 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19152|0 |1 is obsolete| | --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 19154 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19154&action=edit Bug 10480: New cataloging plugin style without redefining This reports changes the way we handle cataloging plugins. Currently, three functions are redefined: plugin_parameters, plugin_javascript and plugin. In this new proposal, communication between addbiblio and the plugin goes via a global variable. The plugin script detects that way if we are building the plugin or executing it. A example plugin is added just to illustrate the concept. Plugin marc21_leader.pl is adjusted to the new style (plus some cosmetic changes: removing tabs etc.) Test plan: Run the MARC editor and test your current plugins. If you use marc21_leader, test it again. Temporarily connect new_example_plugin to some field and test that. Check the log for warnings about redefines. Signed-off-by: Nuno Lopez Ansotegui <nunyo@masmedios.com> Still amended this patch: arrayref $building_plugins => hashref $building_plugin hash entry names: tabno and subfieldid are slightly better slightly adjusted test on passed hash values Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #7 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Could have a signoff again, since I amended my patch. Note that git may have some trouble with diacritics in the commit message.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|nunyo@masmedios.com |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #8 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- I just realize that we do need to make a similar change in additem.pl (of course..) So indeed, it was not perfect yet. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #9 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 19168 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19168&action=edit Bug 10480: Followup for additem.pl (no redefines for plugins) Adds the same functionality for additem as in addbiblio. Note that the new subroutine is slightly different from the addbiblio case. Test plan: Test your cataloging plugins on Add/edit items. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19168|0 |1 is obsolete| | --- Comment #10 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 19169 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19169&action=edit Bug 10480: Followup for additem.pl (no redefines for plugins) Adds the same functionality for additem as in addbiblio. Note that the new subroutine is slightly different from the addbiblio case. Test plan: Test your cataloging plugins on Add/edit items. If you have no one, temporarily connect new_example_plugin.pl; it will only put 12345 in your item field. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gitbot@bugs.koha-community. | |org When did the bot| |2012-09-24 last check this| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- When did the bot|2012-09-24 00:00:00 |2013-09-24 last check this| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- When did the bot|2013-09-24 00:00:00 |2013-10-25 last check this| | --- Comment #11 from I'm just a bot <gitbot@bugs.koha-community.org> --- Patch applied cleanly, go forth and signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |WONTFIX -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX |--- --- Comment #12 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Still want to proceed on this in another direction. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |ASSIGNED Blocks|9921 | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19154|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=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19169|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=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12176 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13305 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13306 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Cataloging plugins without |Improvements for framework |redefining |plugins in cataloguing/item | |editor -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13305 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13305 | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #13 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to M. de Rooy from comment #12)
Still want to proceed on this in another direction.
This took some more time than I hoped for. But will submit them now, based on the concept of two anynomous subroutines. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #14 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 34308 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34308&action=edit Bug 10480: New module and unit test for framework plugins This patch introduces the Koha::FrameworkPlugin object to Koha. This object supports the current "old-style" plugins while adding a new style based on the concept of two anynomous subroutines for building and launching. I will summarize the advantages of this new approach, justifying the additional lines of code in this patch: [1] Centralizing the code for building and launching plugins. [2] Extensive unit testing: this was not possible before. [3] Simplicity: Only define what you need in the plugin. A follow-up patch will delete 1500 lines with *empty* routines. [4] Make it possible to restore the warnings pragma for all plugins. New style plugins do no longer depend on redefinition. [5] Event binding moved from HTML attributes moved to jQuery code. This separates behavior and presentation. [6] Much more documentation, including EXAMPLE plugin in follow-up. [7] Improved error handling. [8] Usability: property noclick tells you if plugin's buttonDot is active. [9] More events supported: Change, keyboard/mouse events. See EXAMPLE. NOTE ON EXAMPLE PLUGIN: The example plugin is added in the third patch of this report. Since it is new style, it can be used only after we start using this object. It also contains an example for a keypress and mouseover event. NOTE ON ITEM PLUGINS: Old style plugins for items contain an additional parameter in the js functions for Blur, Focus and Change. This distinction has no actual use and is resolved for new plugins in the object code. When converting item plugins, this minor correction will be addressed. In the meantime old style item plugins behave as expected. TEST PLAN: Run the new test t/db_dependent/FrameworkPlugin.t At this point in time, you do not need to do anything more. Follow-up patches will incorporate the object in real-life Koha and provide additional test plans. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #15 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 34309 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34309&action=edit Bug 10480: Use the framework plugin object in cataloguing This patch implements the use of Koha::FrameworkPlugin in Cataloguing, Authorities, Acquisition, Serials and Tools. The main change is architectural: see the commit message of the previous patch. No changes in behavior are expected, but the support of new events may provide additional functionality in the future. Some small bugs are resolved along the way. The change primarily focuses on the MARC and items editor in Cataloguing. But the MARC editor for Authorities and the item editor in Acquisition, Serials and Tools are touched too. This commit message gives some comments per module. NOTE FOR CATALOGUING: A new plugin without popup (or other click event code) now shows the title No popup when hovering over the tag editor image. The image alerts the user on a plugin, the title tells about its status. The noclick property allows for further style modifications in the template. Note that a follow-up patch will clean up the old style plugins too with the same effect. Some additional code in cataloging.js makes it possible to clone subfields with plugins (although only theoretically useful). The clones use the same javascript functions but event.data contains an updated id. This effectively resolves bug 13306. Note that if old plugins do not use the javascript parameter for the id but the perl variable, cloning does still operate on the wrong field (with and without this patch set). In the absence of report 12176 in master, it is not yet necessary to modify additem.tt. When it gets pushed, it should be an easy rebase. New style item plugins will no longer need an extra parameter. (The code in the FrameworkPlugin object actually takes care of that.) NOTE FOR AUTHORITIES: This patch also adds class name tag_editor to the buttonDot anchors. This effectively makes the same tag editor image appear as in Cataloguing. Futhermore it removes the button from the tab sequence if there is no click event (really effective after conversion to the new style, since the old style plugins contain empty onclicks and launchers). Both small adjustments increase consistency between auth and bib edits. NOTE FOR ACQUISITION: In Acquisition two scripts use an item editor, but in a different way. The scripts addorderiso2709 and neworderempty both rely on the routine PrepareItemrecordDisplay in C4::Items, but neworderempty creates item blocks dynamically via an ajax call to services/itemrecorddisplay.pl. In order to make the dynamic item blocks work with plugins, some code changes were needed in additem.js. (Normally the event binding is done at document ready time; now it must be done later.) At this moment the routine in Items.pm contains the html tags, and this makes changes to the following templates not necessary for now: * acqui/addorderiso2709.tt * services/itemrecorddisplay.tt Report 13397 has been opened to address moving the html to the templates. NOTE FOR SERIALS: Script serial-edit relies also on C4::Items (just as in Acquisition). This makes changes to serials/serials-edit.tt not necessary for now. NOTE FOR TOOLS: The current code in tools/batchMod.pl allows the use of plugins for batch modification of items. This patch just converts that code to use the new object. Most item plugins however may not be very useful for operating on multiple items at once. PERFORMANCE: I have benchmarked build_tabs in addbiblio to see how especially the additional processing of the javascript in the FrameworkPlugin object would impact performance. Testing default MARC21 framework with 8 plugins gave the following figures: - Old situation: 851 ms - New situation: 942 ms (+10,7%) - New situation after plugin cleanup: 881 ms (+3,4%) Note also that adding lines for event binding is compensated by removing lines for unused events. Page load should essentially be the same. TEST PLAN: Suggestion: If you also apply the next patch with the EXAMPLE plugin, you can test with a rather harmless plugin (with popup) on various places :) But your test should also include old style plugins, with[out] popups. If you want to test a new plugin without popup, rename/remove Click$id in the javascript code of the $builder definition (temporarily). [1] Test Cataloguing: - Add/Edit biblio. Try plugins with and without popup. - Add/Edit items. (EXAMPLE can be used as an item plugin with popup.) - Clone a subfield with plugin (use EXAMPLE): Verify that the plugin works on both original and clone with the respective field values. Is the value put back in the right field too? [2] Test Authorities: Edit an authority record. Try plugins with an without popup. [3] Test Acquisition: Set system preference AcqCreateItem to "placing an order". Check the item editor in the following two places: a- addorderiso2709: Open a basket, add an order from a staged file. Select a file, click Add orders, and go to tab Item information. b- neworderempty: Open a basket, add an order from a new empty record. [4] Test Serials: Check the item editor on serials-edit. Go to subscription detail. Click Receive. Choose "Click to add item". (Note that this subscription should create an item record when receiving this serial.) [5] Test Tools: Check the item editor for batch item modification. Enter a few valid barcodes and press Continue to reach the item editor. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #16 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 34310 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34310&action=edit Bug 10480: EXAMPLE plugin with associated template The EXAMPLE plugin helps you to create a new style framework plugin by providing a simple working example and additional documentation for developers. Test plan: [1] Connect the EXAMPLE plugin to one or more fields. [2] Try the following events: a- Focus: If the field is empty, it should put EXAMPLE: into it. b- MouseOver: If the field is empty and you move your mouse over it, it should have the same effect as Focus. c- Change: Edit the field in the editor and tab out of it, the color of the text should toggle (randomly) between red, green and blue. d- KeyPress: If you edit the field and you type @, it should give AT. e- Click: Click on the tag editor. Change the value in the popup. If you press OK, the field should be changed. [3] Would the documentation in the perl script help you to create a plugin? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #17 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 34311 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34311&action=edit Bug 10480: Remove useless routines and irrelevant pod lines This patch makes the following cleanup actions for all plugins: 1- Remove sub plugin_parameters. This function is not used. 2- Remove empty plugin or empty plugin_javascript subs. 3- Remove empty Blur, Clic or Focus routines from javascript. 4- Remove pod lines (copy-pasta) only referring to the 3 plugin subs. 5- Remove the last 1; line. It is no longer needed. Test plan: Run the unit test t/db_dependent/FrameworkPlugins.t Test some cataloguing plugins in addbiblio. Test some item plugins in additem and neworderempty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I also checked the syntax of all plugins with perl -c. And checked the pod (if any) with podchecker: Two files still produce a warning; the follow-up deals with them: unimarc_field_686a/_700-4.pl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #18 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 34312 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34312&action=edit Bug 10480: Follow-up for unimarc_field_686a/_700-4.pl This patch fixes the pod errors on those two files by removing the pod section that actually does not add anything useful. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #19 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- I will add see also-reports to convert old style plugins to new style plugins for marc21, normarc and unimarc. This can be tested and handled separately however. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13437 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13438 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13439 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34308|0 |1 is obsolete| | --- Comment #20 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35187 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35187&action=edit Bug 10480: New module and unit test for framework plugins This patch introduces the Koha::FrameworkPlugin object to Koha. This object supports the current "old-style" plugins while adding a new style based on the concept of two anynomous subroutines for building and launching. I will summarize the advantages of this new approach, justifying the additional lines of code in this patch: [1] Centralizing the code for building and launching plugins. [2] Extensive unit testing: this was not possible before. [3] Simplicity: Only define what you need in the plugin. A follow-up patch will delete 1500 lines with *empty* routines. [4] Make it possible to restore the warnings pragma for all plugins. New style plugins do no longer depend on redefinition. [5] Event binding moved from HTML attributes moved to jQuery code. This separates behavior and presentation. [6] Much more documentation, including EXAMPLE plugin in follow-up. [7] Improved error handling. [8] Usability: property noclick tells you if plugin's buttonDot is active. [9] More events supported: Change, keyboard/mouse events. See EXAMPLE. NOTE ON EXAMPLE PLUGIN: The example plugin is added in the third patch of this report. Since it is new style, it can be used only after we start using this object. It also contains an example for a keypress and mouseover event. NOTE ON ITEM PLUGINS: Old style plugins for items contain an additional parameter in the js functions for Blur, Focus and Change. This distinction has no actual use and is resolved for new plugins in the object code. When converting item plugins, this minor correction will be addressed. In the meantime old style item plugins behave as expected. TEST PLAN: Run the new test t/db_dependent/FrameworkPlugin.t At this point in time, you do not need to do anything more. Follow-up patches will incorporate the object in real-life Koha and provide additional test plans. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34309|0 |1 is obsolete| | --- Comment #21 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35188 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35188&action=edit Bug 10480: Use the framework plugin object in cataloguing This patch implements the use of Koha::FrameworkPlugin in Cataloguing, Authorities, Acquisition, Serials and Tools. The main change is architectural: see the commit message of the previous patch. No changes in behavior are expected, but the support of new events may provide additional functionality in the future. Some small bugs are resolved along the way. The change primarily focuses on the MARC and items editor in Cataloguing. But the MARC editor for Authorities and the item editor in Acquisition, Serials and Tools are touched too. This commit message gives some comments per module. NOTE FOR CATALOGUING: A new plugin without popup (or other click event code) now shows the title No popup when hovering over the tag editor image. The image alerts the user on a plugin, the title tells about its status. The noclick property allows for further style modifications in the template. Note that a follow-up patch will clean up the old style plugins too with the same effect. Some additional code in cataloging.js makes it possible to clone subfields with plugins (although only theoretically useful). The clones use the same javascript functions but event.data contains an updated id. This effectively resolves bug 13306. Note that if old plugins do not use the javascript parameter for the id but the perl variable, cloning does still operate on the wrong field (with and without this patch set). In the absence of report 12176 in master, it is not yet necessary to modify additem.tt. When it gets pushed, it should be an easy rebase. New style item plugins will no longer need an extra parameter. (The code in the FrameworkPlugin object actually takes care of that.) NOTE FOR AUTHORITIES: This patch also adds class name tag_editor to the buttonDot anchors. This effectively makes the same tag editor image appear as in Cataloguing. Futhermore it removes the button from the tab sequence if there is no click event (really effective after conversion to the new style, since the old style plugins contain empty onclicks and launchers). Both small adjustments increase consistency between auth and bib edits. NOTE FOR ACQUISITION: In Acquisition two scripts use an item editor, but in a different way. The scripts addorderiso2709 and neworderempty both rely on the routine PrepareItemrecordDisplay in C4::Items, but neworderempty creates item blocks dynamically via an ajax call to services/itemrecorddisplay.pl. In order to make the dynamic item blocks work with plugins, some code changes were needed in additem.js. (Normally the event binding is done at document ready time; now it must be done later.) At this moment the routine in Items.pm contains the html tags, and this makes changes to the following templates not necessary for now: * acqui/addorderiso2709.tt * services/itemrecorddisplay.tt Report 13397 has been opened to address moving the html to the templates. NOTE FOR SERIALS: Script serial-edit relies also on C4::Items (just as in Acquisition). This makes changes to serials/serials-edit.tt not necessary for now. NOTE FOR TOOLS: The current code in tools/batchMod.pl allows the use of plugins for batch modification of items. This patch just converts that code to use the new object. Most item plugins however may not be very useful for operating on multiple items at once. PERFORMANCE: I have benchmarked build_tabs in addbiblio to see how especially the additional processing of the javascript in the FrameworkPlugin object would impact performance. Testing default MARC21 framework with 8 plugins gave the following figures: - Old situation: 851 ms - New situation: 942 ms (+10,7%) - New situation after plugin cleanup: 881 ms (+3,4%) Note also that adding lines for event binding is compensated by removing lines for unused events. Page load should essentially be the same. TEST PLAN: Suggestion: If you also apply the next patch with the EXAMPLE plugin, you can test with a rather harmless plugin (with popup) on various places :) But your test should also include old style plugins, with[out] popups. If you want to test a new plugin without popup, rename/remove Click$id in the javascript code of the $builder definition (temporarily). [1] Test Cataloguing: - Add/Edit biblio. Try plugins with and without popup. - Add/Edit items. (EXAMPLE can be used as an item plugin with popup.) - Clone a subfield with plugin (use EXAMPLE): Verify that the plugin works on both original and clone with the respective field values. Is the value put back in the right field too? [2] Test Authorities: Edit an authority record. Try plugins with an without popup. [3] Test Acquisition: Set system preference AcqCreateItem to "placing an order". Check the item editor in the following two places: a- addorderiso2709: Open a basket, add an order from a staged file. Select a file, click Add orders, and go to tab Item information. b- neworderempty: Open a basket, add an order from a new empty record. [4] Test Serials: Check the item editor on serials-edit. Go to subscription detail. Click Receive. Choose "Click to add item". (Note that this subscription should create an item record when receiving this serial.) [5] Test Tools: Check the item editor for batch item modification. Enter a few valid barcodes and press Continue to reach the item editor. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34310|0 |1 is obsolete| | --- Comment #22 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35189 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35189&action=edit Bug 10480: EXAMPLE plugin with associated template The EXAMPLE plugin helps you to create a new style framework plugin by providing a simple working example and additional documentation for developers. Test plan: [1] Connect the EXAMPLE plugin to one or more fields. [2] Try the following events: a- Focus: If the field is empty, it should put EXAMPLE: into it. b- MouseOver: If the field is empty and you move your mouse over it, it should have the same effect as Focus. c- Change: Edit the field in the editor and tab out of it, the color of the text should toggle (randomly) between red, green and blue. d- KeyPress: If you edit the field and you type @, it should give AT. e- Click: Click on the tag editor. Change the value in the popup. If you press OK, the field should be changed. [3] Would the documentation in the perl script help you to create a plugin? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34311|0 |1 is obsolete| | --- Comment #23 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35190 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35190&action=edit Bug 10480: Remove useless routines and irrelevant pod lines This patch makes the following cleanup actions for all plugins: 1- Remove sub plugin_parameters. This function is not used. 2- Remove empty plugin or empty plugin_javascript subs. 3- Remove empty Blur, Clic or Focus routines from javascript. 4- Remove pod lines (copy-pasta) only referring to the 3 plugin subs. 5- Remove the last 1; line. It is no longer needed. Test plan: Run the unit test t/db_dependent/FrameworkPlugins.t Test some cataloguing plugins in addbiblio. Test some item plugins in additem and neworderempty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I also checked the syntax of all plugins with perl -c. And checked the pod (if any) with podchecker: Two files still produce a warning; the follow-up deals with them: unimarc_field_686a/_700-4.pl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34312|0 |1 is obsolete| | --- Comment #24 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35191 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35191&action=edit Bug 10480: Follow-up for unimarc_field_686a/_700-4.pl This patch fixes the pod errors on those two files by removing the pod section that actually does not add anything useful. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #25 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Rebased. Anyone willing to help getting this further? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35190|0 |1 is obsolete| | Attachment #35191|0 |1 is obsolete| | --- Comment #26 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35286 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35286&action=edit Bug 10480: Remove useless routines and irrelevant pod lines This patch makes the following cleanup actions for all plugins: 1- Remove sub plugin_parameters. This function is not used. 2- Remove empty plugin or empty plugin_javascript subs. 3- Remove empty Blur, Clic or Focus routines from javascript. 4- Remove pod lines (copy-pasta) only referring to the 3 plugin subs. 5- Remove the last 1; line. It is no longer needed. Test plan: Run the unit test t/db_dependent/FrameworkPlugins.t Test some cataloguing plugins in addbiblio. Test some item plugins in additem and neworderempty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I also checked the syntax of all plugins with perl -c. And checked the pod (if any) with podchecker: Two files still produce a warning; the follow-up deals with them: unimarc_field_686a/_700-4.pl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #27 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 35287 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35287&action=edit Bug 10480: Follow-up for unimarc_field_686a/_700-4.pl This patch fixes the pod errors on those two files by removing the pod section that actually does not add anything useful. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@quecheelibrary.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Brendan Gallagher <brendan@bywatersolutions.com> 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=10480 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35187|0 |1 is obsolete| | --- Comment #28 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 36106 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36106&action=edit Bug 10480: New module and unit test for framework plugins This patch introduces the Koha::FrameworkPlugin object to Koha. This object supports the current "old-style" plugins while adding a new style based on the concept of two anynomous subroutines for building and launching. I will summarize the advantages of this new approach, justifying the additional lines of code in this patch: [1] Centralizing the code for building and launching plugins. [2] Extensive unit testing: this was not possible before. [3] Simplicity: Only define what you need in the plugin. A follow-up patch will delete 1500 lines with *empty* routines. [4] Make it possible to restore the warnings pragma for all plugins. New style plugins do no longer depend on redefinition. [5] Event binding moved from HTML attributes moved to jQuery code. This separates behavior and presentation. [6] Much more documentation, including EXAMPLE plugin in follow-up. [7] Improved error handling. [8] Usability: property noclick tells you if plugin's buttonDot is active. [9] More events supported: Change, keyboard/mouse events. See EXAMPLE. NOTE ON EXAMPLE PLUGIN: The example plugin is added in the third patch of this report. Since it is new style, it can be used only after we start using this object. It also contains an example for a keypress and mouseover event. NOTE ON ITEM PLUGINS: Old style plugins for items contain an additional parameter in the js functions for Blur, Focus and Change. This distinction has no actual use and is resolved for new plugins in the object code. When converting item plugins, this minor correction will be addressed. In the meantime old style item plugins behave as expected. TEST PLAN: Run the new test t/db_dependent/FrameworkPlugin.t At this point in time, you do not need to do anything more. Follow-up patches will incorporate the object in real-life Koha and provide additional test plans. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35188|0 |1 is obsolete| | --- Comment #29 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 36107 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36107&action=edit Bug 10480: Use the framework plugin object in cataloguing This patch implements the use of Koha::FrameworkPlugin in Cataloguing, Authorities, Acquisition, Serials and Tools. The main change is architectural: see the commit message of the previous patch. No changes in behavior are expected, but the support of new events may provide additional functionality in the future. Some small bugs are resolved along the way. The change primarily focuses on the MARC and items editor in Cataloguing. But the MARC editor for Authorities and the item editor in Acquisition, Serials and Tools are touched too. This commit message gives some comments per module. NOTE FOR CATALOGUING: A new plugin without popup (or other click event code) now shows the title No popup when hovering over the tag editor image. The image alerts the user on a plugin, the title tells about its status. The noclick property allows for further style modifications in the template. Note that a follow-up patch will clean up the old style plugins too with the same effect. Some additional code in cataloging.js makes it possible to clone subfields with plugins (although only theoretically useful). The clones use the same javascript functions but event.data contains an updated id. This effectively resolves bug 13306. Note that if old plugins do not use the javascript parameter for the id but the perl variable, cloning does still operate on the wrong field (with and without this patch set). In the absence of report 12176 in master, it is not yet necessary to modify additem.tt. When it gets pushed, it should be an easy rebase. New style item plugins will no longer need an extra parameter. (The code in the FrameworkPlugin object actually takes care of that.) NOTE FOR AUTHORITIES: This patch also adds class name tag_editor to the buttonDot anchors. This effectively makes the same tag editor image appear as in Cataloguing. Futhermore it removes the button from the tab sequence if there is no click event (really effective after conversion to the new style, since the old style plugins contain empty onclicks and launchers). Both small adjustments increase consistency between auth and bib edits. NOTE FOR ACQUISITION: In Acquisition two scripts use an item editor, but in a different way. The scripts addorderiso2709 and neworderempty both rely on the routine PrepareItemrecordDisplay in C4::Items, but neworderempty creates item blocks dynamically via an ajax call to services/itemrecorddisplay.pl. In order to make the dynamic item blocks work with plugins, some code changes were needed in additem.js. (Normally the event binding is done at document ready time; now it must be done later.) At this moment the routine in Items.pm contains the html tags, and this makes changes to the following templates not necessary for now: * acqui/addorderiso2709.tt * services/itemrecorddisplay.tt Report 13397 has been opened to address moving the html to the templates. NOTE FOR SERIALS: Script serial-edit relies also on C4::Items (just as in Acquisition). This makes changes to serials/serials-edit.tt not necessary for now. NOTE FOR TOOLS: The current code in tools/batchMod.pl allows the use of plugins for batch modification of items. This patch just converts that code to use the new object. Most item plugins however may not be very useful for operating on multiple items at once. PERFORMANCE: I have benchmarked build_tabs in addbiblio to see how especially the additional processing of the javascript in the FrameworkPlugin object would impact performance. Testing default MARC21 framework with 8 plugins gave the following figures: - Old situation: 851 ms - New situation: 942 ms (+10,7%) - New situation after plugin cleanup: 881 ms (+3,4%) Note also that adding lines for event binding is compensated by removing lines for unused events. Page load should essentially be the same. TEST PLAN: Suggestion: If you also apply the next patch with the EXAMPLE plugin, you can test with a rather harmless plugin (with popup) on various places :) But your test should also include old style plugins, with[out] popups. If you want to test a new plugin without popup, rename/remove Click$id in the javascript code of the $builder definition (temporarily). [1] Test Cataloguing: - Add/Edit biblio. Try plugins with and without popup. - Add/Edit items. (EXAMPLE can be used as an item plugin with popup.) - Clone a subfield with plugin (use EXAMPLE): Verify that the plugin works on both original and clone with the respective field values. Is the value put back in the right field too? [2] Test Authorities: Edit an authority record. Try plugins with an without popup. [3] Test Acquisition: Set system preference AcqCreateItem to "placing an order". Check the item editor in the following two places: a- addorderiso2709: Open a basket, add an order from a staged file. Select a file, click Add orders, and go to tab Item information. b- neworderempty: Open a basket, add an order from a new empty record. [4] Test Serials: Check the item editor on serials-edit. Go to subscription detail. Click Receive. Choose "Click to add item". (Note that this subscription should create an item record when receiving this serial.) [5] Test Tools: Check the item editor for batch item modification. Enter a few valid barcodes and press Continue to reach the item editor. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35189|0 |1 is obsolete| | --- Comment #30 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 36108 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36108&action=edit Bug 10480: EXAMPLE plugin with associated template The EXAMPLE plugin helps you to create a new style framework plugin by providing a simple working example and additional documentation for developers. Test plan: [1] Connect the EXAMPLE plugin to one or more fields. [2] Try the following events: a- Focus: If the field is empty, it should put EXAMPLE: into it. b- MouseOver: If the field is empty and you move your mouse over it, it should have the same effect as Focus. c- Change: Edit the field in the editor and tab out of it, the color of the text should toggle (randomly) between red, green and blue. d- KeyPress: If you edit the field and you type @, it should give AT. e- Click: Click on the tag editor. Change the value in the popup. If you press OK, the field should be changed. [3] Would the documentation in the perl script help you to create a plugin? Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35286|0 |1 is obsolete| | --- Comment #31 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 36109 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36109&action=edit Bug 10480: Remove useless routines and irrelevant pod lines This patch makes the following cleanup actions for all plugins: 1- Remove sub plugin_parameters. This function is not used. 2- Remove empty plugin or empty plugin_javascript subs. 3- Remove empty Blur, Clic or Focus routines from javascript. 4- Remove pod lines (copy-pasta) only referring to the 3 plugin subs. 5- Remove the last 1; line. It is no longer needed. Test plan: Run the unit test t/db_dependent/FrameworkPlugins.t Test some cataloguing plugins in addbiblio. Test some item plugins in additem and neworderempty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I also checked the syntax of all plugins with perl -c. And checked the pod (if any) with podchecker: Two files still produce a warning; the follow-up deals with them: unimarc_field_686a/_700-4.pl. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35287|0 |1 is obsolete| | --- Comment #32 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 36110 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36110&action=edit Bug 10480: Follow-up for unimarc_field_686a/_700-4.pl This patch fixes the pod errors on those two files by removing the pod section that actually does not add anything useful. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m --- Comment #33 from Brendan Gallagher <brendan@bywatersolutions.com> --- Notes - Followed test plan and recommendations. I couldn't find anything wrong with it. It took me a long time to get through it - not sure if I am just slow or what - so heads up for QA (I poked at parts for a few differnt days . As I went through it I didn't really find an extra area that needed checking. So QA should be able to follow plans forward. Also read through the code and didn't find anything that was out of place for code. Thanks, Brendan -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #34 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Brendan Gallagher from comment #33)
Followed test plan and recommendations. I couldn't find anything wrong with it. It took me a long time to get through it - not sure if I am just slow or what - so heads up for QA (I poked at parts for a few differnt days . As I went through it I didn't really find an extra area that needed checking. So QA should be able to follow plans forward. Also read through the code and didn't find anything that was out of place for code.
Thanks! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement CC| |katrin.fischer@bsz-bw.de --- Comment #35 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think this probably shouldn't go on to the stable branches as it would break custom plugins the library might have. As the title says "improvements" switching to "enh" - but I know it's not quite. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #36 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #35)
I think this probably shouldn't go on to the stable branches as it would break custom plugins the library might have.
Do you have any reasons to say that it would break custom plugins? Part of some complexity here is backward compatibility. BTW I agree that this is not targeted for the stable branches in the first place. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36106|0 |1 is obsolete| | Attachment #36107|0 |1 is obsolete| | Attachment #36108|0 |1 is obsolete| | Attachment #36109|0 |1 is obsolete| | Attachment #36110|0 |1 is obsolete| | --- Comment #37 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36953 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36953&action=edit Bug 10480: New module and unit test for framework plugins -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #38 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36954 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36954&action=edit Bug 10480: Use the framework plugin object in cataloguing -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #39 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36955 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36955&action=edit Bug 10480: EXAMPLE plugin with associated template -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #40 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36956 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36956&action=edit Bug 10480: Remove useless routines and irrelevant pod lines -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #41 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36957 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36957&action=edit Bug 10480: Follow-up for unimarc_field_686a/_700-4.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #42 from Jonathan Druart <jonathan.druart@biblibre.com> --- Great work Marcel! I did not find any regression and the code looks better than before. I really would like to see this one moving forward to motivate you to continue the job :) However I would like to get another pair of eyes on it, that's why I don't change the status for now. Just one question: The EXAMPLE plugin should be removed (or not pushed) or hidden in the dropdown list, don't you think? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #43 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #42)
I did not find any regression and the code looks better than before. I really would like to see this one moving forward to motivate you to continue the job :) However I would like to get another pair of eyes on it, that's why I don't change the status for now. Thanks for testing.
Just one question: The EXAMPLE plugin should be removed (or not pushed) or hidden in the dropdown list, don't you think? It is some kind of documentation; also easy to copy and extend it etc. But we could certainly hide in the dropdown list. That would be a trivial follow-up.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36953|0 |1 is obsolete| | Attachment #36954|0 |1 is obsolete| | Attachment #36955|0 |1 is obsolete| | Attachment #36956|0 |1 is obsolete| | Attachment #36957|0 |1 is obsolete| | --- Comment #44 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37948 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37948&action=edit [PASSED QA] Bug 10480: New module and unit test for framework plugins This patch introduces the Koha::FrameworkPlugin object to Koha. This object supports the current "old-style" plugins while adding a new style based on the concept of two anynomous subroutines for building and launching. I will summarize the advantages of this new approach, justifying the additional lines of code in this patch: [1] Centralizing the code for building and launching plugins. [2] Extensive unit testing: this was not possible before. [3] Simplicity: Only define what you need in the plugin. A follow-up patch will delete 1500 lines with *empty* routines. [4] Make it possible to restore the warnings pragma for all plugins. New style plugins do no longer depend on redefinition. [5] Event binding moved from HTML attributes moved to jQuery code. This separates behavior and presentation. [6] Much more documentation, including EXAMPLE plugin in follow-up. [7] Improved error handling. [8] Usability: property noclick tells you if plugin's buttonDot is active. [9] More events supported: Change, keyboard/mouse events. See EXAMPLE. NOTE ON EXAMPLE PLUGIN: The example plugin is added in the third patch of this report. Since it is new style, it can be used only after we start using this object. It also contains an example for a keypress and mouseover event. NOTE ON ITEM PLUGINS: Old style plugins for items contain an additional parameter in the js functions for Blur, Focus and Change. This distinction has no actual use and is resolved for new plugins in the object code. When converting item plugins, this minor correction will be addressed. In the meantime old style item plugins behave as expected. TEST PLAN: Run the new test t/db_dependent/FrameworkPlugin.t At this point in time, you do not need to do anything more. Follow-up patches will incorporate the object in real-life Koha and provide additional test plans. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37948|0 |1 is obsolete| | --- Comment #45 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37949 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37949&action=edit [PASSED QA] Bug 10480: New module and unit test for framework plugins This patch introduces the Koha::FrameworkPlugin object to Koha. This object supports the current "old-style" plugins while adding a new style based on the concept of two anynomous subroutines for building and launching. I will summarize the advantages of this new approach, justifying the additional lines of code in this patch: [1] Centralizing the code for building and launching plugins. [2] Extensive unit testing: this was not possible before. [3] Simplicity: Only define what you need in the plugin. A follow-up patch will delete 1500 lines with *empty* routines. [4] Make it possible to restore the warnings pragma for all plugins. New style plugins do no longer depend on redefinition. [5] Event binding moved from HTML attributes moved to jQuery code. This separates behavior and presentation. [6] Much more documentation, including EXAMPLE plugin in follow-up. [7] Improved error handling. [8] Usability: property noclick tells you if plugin's buttonDot is active. [9] More events supported: Change, keyboard/mouse events. See EXAMPLE. NOTE ON EXAMPLE PLUGIN: The example plugin is added in the third patch of this report. Since it is new style, it can be used only after we start using this object. It also contains an example for a keypress and mouseover event. NOTE ON ITEM PLUGINS: Old style plugins for items contain an additional parameter in the js functions for Blur, Focus and Change. This distinction has no actual use and is resolved for new plugins in the object code. When converting item plugins, this minor correction will be addressed. In the meantime old style item plugins behave as expected. TEST PLAN: Run the new test t/db_dependent/FrameworkPlugin.t At this point in time, you do not need to do anything more. Follow-up patches will incorporate the object in real-life Koha and provide additional test plans. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #46 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37950 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37950&action=edit [PASSED QA] Bug 10480: Use the framework plugin object in cataloguing This patch implements the use of Koha::FrameworkPlugin in Cataloguing, Authorities, Acquisition, Serials and Tools. The main change is architectural: see the commit message of the previous patch. No changes in behavior are expected, but the support of new events may provide additional functionality in the future. Some small bugs are resolved along the way. The change primarily focuses on the MARC and items editor in Cataloguing. But the MARC editor for Authorities and the item editor in Acquisition, Serials and Tools are touched too. This commit message gives some comments per module. NOTE FOR CATALOGUING: A new plugin without popup (or other click event code) now shows the title No popup when hovering over the tag editor image. The image alerts the user on a plugin, the title tells about its status. The noclick property allows for further style modifications in the template. Note that a follow-up patch will clean up the old style plugins too with the same effect. Some additional code in cataloging.js makes it possible to clone subfields with plugins (although only theoretically useful). The clones use the same javascript functions but event.data contains an updated id. This effectively resolves bug 13306. Note that if old plugins do not use the javascript parameter for the id but the perl variable, cloning does still operate on the wrong field (with and without this patch set). In the absence of report 12176 in master, it is not yet necessary to modify additem.tt. When it gets pushed, it should be an easy rebase. New style item plugins will no longer need an extra parameter. (The code in the FrameworkPlugin object actually takes care of that.) NOTE FOR AUTHORITIES: This patch also adds class name tag_editor to the buttonDot anchors. This effectively makes the same tag editor image appear as in Cataloguing. Futhermore it removes the button from the tab sequence if there is no click event (really effective after conversion to the new style, since the old style plugins contain empty onclicks and launchers). Both small adjustments increase consistency between auth and bib edits. NOTE FOR ACQUISITION: In Acquisition two scripts use an item editor, but in a different way. The scripts addorderiso2709 and neworderempty both rely on the routine PrepareItemrecordDisplay in C4::Items, but neworderempty creates item blocks dynamically via an ajax call to services/itemrecorddisplay.pl. In order to make the dynamic item blocks work with plugins, some code changes were needed in additem.js. (Normally the event binding is done at document ready time; now it must be done later.) At this moment the routine in Items.pm contains the html tags, and this makes changes to the following templates not necessary for now: * acqui/addorderiso2709.tt * services/itemrecorddisplay.tt Report 13397 has been opened to address moving the html to the templates. NOTE FOR SERIALS: Script serial-edit relies also on C4::Items (just as in Acquisition). This makes changes to serials/serials-edit.tt not necessary for now. NOTE FOR TOOLS: The current code in tools/batchMod.pl allows the use of plugins for batch modification of items. This patch just converts that code to use the new object. Most item plugins however may not be very useful for operating on multiple items at once. PERFORMANCE: I have benchmarked build_tabs in addbiblio to see how especially the additional processing of the javascript in the FrameworkPlugin object would impact performance. Testing default MARC21 framework with 8 plugins gave the following figures: - Old situation: 851 ms - New situation: 942 ms (+10,7%) - New situation after plugin cleanup: 881 ms (+3,4%) Note also that adding lines for event binding is compensated by removing lines for unused events. Page load should essentially be the same. TEST PLAN: Suggestion: If you also apply the next patch with the EXAMPLE plugin, you can test with a rather harmless plugin (with popup) on various places :) But your test should also include old style plugins, with[out] popups. If you want to test a new plugin without popup, rename/remove Click$id in the javascript code of the $builder definition (temporarily). [1] Test Cataloguing: - Add/Edit biblio. Try plugins with and without popup. - Add/Edit items. (EXAMPLE can be used as an item plugin with popup.) - Clone a subfield with plugin (use EXAMPLE): Verify that the plugin works on both original and clone with the respective field values. Is the value put back in the right field too? [2] Test Authorities: Edit an authority record. Try plugins with an without popup. [3] Test Acquisition: Set system preference AcqCreateItem to "placing an order". Check the item editor in the following two places: a- addorderiso2709: Open a basket, add an order from a staged file. Select a file, click Add orders, and go to tab Item information. b- neworderempty: Open a basket, add an order from a new empty record. [4] Test Serials: Check the item editor on serials-edit. Go to subscription detail. Click Receive. Choose "Click to add item". (Note that this subscription should create an item record when receiving this serial.) [5] Test Tools: Check the item editor for batch item modification. Enter a few valid barcodes and press Continue to reach the item editor. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #47 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37951 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37951&action=edit [PASSED QA] Bug 10480: EXAMPLE plugin with associated template The EXAMPLE plugin helps you to create a new style framework plugin by providing a simple working example and additional documentation for developers. Test plan: [1] Connect the EXAMPLE plugin to one or more fields. [2] Try the following events: a- Focus: If the field is empty, it should put EXAMPLE: into it. b- MouseOver: If the field is empty and you move your mouse over it, it should have the same effect as Focus. c- Change: Edit the field in the editor and tab out of it, the color of the text should toggle (randomly) between red, green and blue. d- KeyPress: If you edit the field and you type @, it should give AT. e- Click: Click on the tag editor. Change the value in the popup. If you press OK, the field should be changed. [3] Would the documentation in the perl script help you to create a plugin? Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #48 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37952 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37952&action=edit [PASSED QA] Bug 10480: Remove useless routines and irrelevant pod lines This patch makes the following cleanup actions for all plugins: 1- Remove sub plugin_parameters. This function is not used. 2- Remove empty plugin or empty plugin_javascript subs. 3- Remove empty Blur, Clic or Focus routines from javascript. 4- Remove pod lines (copy-pasta) only referring to the 3 plugin subs. 5- Remove the last 1; line. It is no longer needed. Test plan: Run the unit test t/db_dependent/FrameworkPlugins.t Test some cataloguing plugins in addbiblio. Test some item plugins in additem and neworderempty. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I also checked the syntax of all plugins with perl -c. And checked the pod (if any) with podchecker: Two files still produce a warning; the follow-up deals with them: unimarc_field_686a/_700-4.pl. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #49 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37953 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37953&action=edit [PASSED QA] Bug 10480: Follow-up for unimarc_field_686a/_700-4.pl This patch fixes the pod errors on those two files by removing the pod section that actually does not add anything useful. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #50 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 37983 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37983&action=edit Bug 10480: (QA followup) hide the EXAMPLE.pl plugin The EXAMPLE.pl plugin remains on the source tree for documentation purposes only, and shouldn't be listed when editing both biblio and authority cataloguing frameworks. 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=10480 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #51 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Enhancement pushed to master. Great work Marcel! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #52 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #51)
Enhancement pushed to master.
And thanks for your follow-up. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #53 from Jonathan Druart <jonathan.druart@biblibre.com> --- I found a bug: 1/ Open the console 2/ Go on the new order page 3/ TypeError: events is null for(i=0; i<events.length; i++) { additem.js (ligne 176, col. 13) I suppose it happens when none of the fields use a plugin -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14327 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 --- Comment #54 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #53)
I found a bug: 1/ Open the console 2/ Go on the new order page 3/ TypeError: events is null for(i=0; i<events.length; i++) { additem.js (ligne 176, col. 13)
I suppose it happens when none of the fields use a plugin
Thanks for reporting. See bug 14327. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10480 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14660 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14660 [Bug 14660] Cataloguing plugins for generating inventory numbers are broken -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org