There is a YUI autocomplete instance in a UNIMARC plugin (unimarc_field_210c_bis.tt) which I couldn't figure out how to test, even on a sandbox set up with UNIMARC. I could use help with a follow-up to Bug 7747.
Created attachment 15997 [details] [review] Bug 8278 - Replace YUI autocomplete in UNIMARC 210c plugin This plugin, for pseudo-authority-control of publisher information, used YUI autocomplete to pull existing publisher data from the biblioitems table. Despite its name it is not UNIMARC-specific. It assumes publisher name data is saved in biblioitems. This patch converts the autocomplete to jQueryUI. The search script has been amended to return valid JSON. The template has been modified to enable the jQueryUI autocomplete and to add structure more consistent with other popups. To test, link the publisher name field in your MARC structure to the unimarc_field_210c_bis.pl plugin. Open a MARC record for editing and click the "tag editor" link to launch the plugin. Type the first few letters of a publisher which exists in your database. You should get an autocomplete menu of publishers which match your search. Select one and click the "choose" button to fill the field in the MARC editor.
Created attachment 16441 [details] [review] [SIGNED-OFF] Bug 8278 - Replace YUI autocomplete in UNIMARC 210c plugin This plugin, for pseudo-authority-control of publisher information, used YUI autocomplete to pull existing publisher data from the biblioitems table. Despite its name it is not UNIMARC-specific. It assumes publisher name data is saved in biblioitems. This patch converts the autocomplete to jQueryUI. The search script has been amended to return valid JSON. The template has been modified to enable the jQueryUI autocomplete and to add structure more consistent with other popups. To test, link the publisher name field in your MARC structure to the unimarc_field_210c_bis.pl plugin. Open a MARC record for editing and click the "tag editor" link to launch the plugin. Type the first few letters of a publisher which exists in your database. You should get an autocomplete menu of publishers which match your search. Select one and click the "choose" button to fill the field in the MARC editor. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: work as described. No errors. Test: link 260b to plugin. Edit record and search first letters of present editors. Menú appears and can select and fill value. Why plugin 210c_bis talk about field 225a?
Owen, could you take another look at this? 1) The Heading about 225a seems to be not right? 2) I can't get autocomplete to work. I looked up an existing publisher from biblioitems.publishercode and tried typing the name "Gütersloher" and "Klett" After typing a few letters I can see that the processing symbol appear, but nothing is found. Tested in Firefox and Chromium in Ubuntu. Also happens when I try to test bug 9282.
What Katrin and I have discovered is that if you trigger the script directly or indirectly via the plugin you'll get different outcomes if you're logged in as a superlibrarian versus a regular librarian with cataloging privileges. To access the script directly: /cgi-bin/koha/cataloguing/ysearch.pl?table=biblioitems&field=itemtype&query=press If you're logged in as a superlibrarian that should produce valid output. If you're logged in as a regular user with cataloging permission you get no output and your session is terminated. I also see errors in the log: Use of uninitialized value in numeric eq (==) at /C4/Auth.pm line 1687 Use of uninitialized value $lasttime in numeric lt (<) at /C4/Auth.pm line 703. I'm not sure why this script is problematic. It's virtually identical to circ/ysearch.pl which didn't show the same issues when I tested it.
Looking into this now
(In reply to comment #5) > Looking into this now And yes I can full recreate the issue Owen and Katrin describe, if the permissions don't match, it logs you out.
Created attachment 17110 [details] [review] Bug 8278 : Follow up, fixing the permissions on cataloguing/ysearch.pl
Created attachment 17189 [details] [review] [SIGNED-OFF] Bug 8278 : Follow up, fixing the permissions on cataloguing/ysearch.pl Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Works. No errors. Without patch and normal staff user, logged out With patch, normal staff, valid output.
Created attachment 17475 [details] [review] Bug 8278 [Follow-up] Replace YUI autocomplete in UNIMARC 210c plugin This follow-up corrects the heading of the plugin pop-up window to match the UNIMARC field it targets. To test, trigger the plugin and confirm that the pop-up window refers to 210c.
Created attachment 17480 [details] [review] [SIGNED-OFF] Bug 8278 [Follow-up] Replace YUI autocomplete in UNIMARC 210c plugin This follow-up corrects the heading of the plugin pop-up window to match the UNIMARC field it targets. To test, trigger the plugin and confirm that the pop-up window refers to 210c. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Smple patch, fixes label. No errors.
QA comment: Works as before, no regression found. Just one little remark: it would be great to use the JSON::to_json routine in order not to build manually the expected structure (in cataloguing/ysearch.pl). Marked as Failed QA.
Created attachment 17597 [details] [review] Bug 8278: build the structure with to_json instead of manually. Test plan: Same as previously.
Created attachment 17937 [details] [review] [Signed-Off] Bug 8278: build the structure with to_json instead of manually. Test plan: Same as previously. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(In reply to comment #7) > Created attachment 17110 [details] [review] [review] > Bug 8278 : Follow up, fixing the permissions on cataloguing/ysearch.pl Katrin, could you confirm this patch fixes your issue please?
Created attachment 18002 [details] [review] [PASSED QA] Bug 8278 - Replace YUI autocomplete in UNIMARC 210c plugin This plugin, for pseudo-authority-control of publisher information, used YUI autocomplete to pull existing publisher data from the biblioitems table. Despite its name it is not UNIMARC-specific. It assumes publisher name data is saved in biblioitems. This patch converts the autocomplete to jQueryUI. The search script has been amended to return valid JSON. The template has been modified to enable the jQueryUI autocomplete and to add structure more consistent with other popups. To test, link the publisher name field in your MARC structure to the unimarc_field_210c_bis.pl plugin. Open a MARC record for editing and click the "tag editor" link to launch the plugin. Type the first few letters of a publisher which exists in your database. You should get an autocomplete menu of publishers which match your search. Select one and click the "choose" button to fill the field in the MARC editor. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: work as described. No errors. Test: link 260b to plugin. Edit record and search first letters of present editors. Menú appears and can select and fill value. Why plugin 210c_bis talk about field 225a? Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Plugin now works correctly for me, even when linked to 260$b in a MARC21 installation. All tests and QA script pass.
Created attachment 18003 [details] [review] [PASSED QA] Bug 8278 : Follow up, fixing the permissions on cataloguing/ysearch.pl Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Works. No errors. Without patch and normal staff user, logged out With patch, normal staff, valid output. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 18004 [details] [review] [PASSED QA] Bug 8278 [Follow-up] Replace YUI autocomplete in UNIMARC 210c plugin This follow-up corrects the heading of the plugin pop-up window to match the UNIMARC field it targets. To test, trigger the plugin and confirm that the pop-up window refers to 210c. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Smple patch, fixes label. No errors. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 18005 [details] [review] [PASSED QA] Bug 8278: build the structure with to_json instead of manually. Test plan: Same as previously. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This patch has been pushed to master and 3.12.x.