Bug 32817

Summary: Clean up cataloguing/value_builder/dateaccessioned.pl
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: CatalogingAssignee: Julian Maurice <julian.maurice>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: trivial    
Priority: P5 - low CC: david, lucas, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06
Circulation function:
Bug Depends on:    
Bug Blocks: 30975    
Attachments: Bug 32817: Fix cataloguing/value_builder/dateaccessioned.pl
Bug 32817: Stop links from jumping to top of page
Bug 32817: Fix cataloguing/value_builder/dateaccessioned.pl
Bug 32817: Fix cataloguing/value_builder/dateaccessioned.pl

Description Julian Maurice 2023-02-03 11:22:49 UTC
This is part of the refactoring happening in bug 30975
Comment 1 Julian Maurice 2023-02-03 11:23:19 UTC
Created attachment 146075 [details] [review]
Bug 32817: Fix cataloguing/value_builder/dateaccessioned.pl

Remove unnecessary call to event.preventDefault()

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before
Comment 2 Lucas Gass (lukeg) 2023-02-04 00:11:24 UTC
When I add the plugin to a 952 field like 'Date acquired' and then go to an item record, when I like on the '...' the page jumps back to the top. This doesn't happen without the patch.

This appears to happen for me in both Chrome and Firefox.
Comment 3 Lucas Gass (lukeg) 2023-02-04 00:20:18 UTC
We can stop the links for jumping by using "#/" instead of "#" as the href.
Comment 4 Lucas Gass (lukeg) 2023-02-04 00:21:41 UTC
Created attachment 146175 [details] [review]
Bug 32817: Stop links from jumping to top of page
Comment 5 Julian Maurice 2023-02-06 07:02:05 UTC
Ah, sorry...
The call to preventDefault should be removed after bug 30975 is pushed. I'll fix the dependency order
Comment 6 Lucas Gass (lukeg) 2023-02-06 15:30:23 UTC
(In reply to Julian Maurice from comment #5)
> Ah, sorry...
> The call to preventDefault should be removed after bug 30975 is pushed. I'll
> fix the dependency order

Ah I see, thanks! It looks like the dependency order for most the bugs linked to Bug 30975 need changed as well, right?
Comment 7 Julian Maurice 2023-02-06 15:40:49 UTC
(In reply to Lucas Gass from comment #6)
> Ah I see, thanks! It looks like the dependency order for most the bugs
> linked to Bug 30975 need changed as well, right?
No, most of them are really required for bug 30975.
This one was only an unnecessary cleanup (bug 30975 adds the call to event.preventDefault outside of the plugin code).
There might be others, i will check them all.
Comment 8 David Nind 2023-03-28 19:21:25 UTC
Created attachment 148846 [details] [review]
Bug 32817: Fix cataloguing/value_builder/dateaccessioned.pl

Remove unnecessary call to event.preventDefault()

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2023-03-28 19:45:19 UTC
How I tested
~~~~~~~~~~~~

1. Applied bug 30975 (interactive, commented out the first patch) - this takes a while as you have to say yes to all the dependent bugs.
2. The plugin dateaccessioned.pl is already added in KTD to:
   2.1 subfield 995$5 for the default UNIMARC bibliographic framework (need to edit to make visible in the editor)
   2.1 subfield 952$d for the BKS MARC21 bibliographic framework (already visible in the editor)
3. Edit a bibliographic record.
4. Select the tag editor for the subfield.
5. Options and values should be the same before and after the patch is applied.

Description
~~~~~~~~~~~

This is a standard cataloguing plugin. It displays the flatpickr date widget to let you select the date an item was acquired (995$5 in UNIMARC and 952$d in MARC21).
Comment 10 Katrin Fischer 2023-04-22 21:23:10 UTC
Created attachment 150096 [details] [review]
Bug 32817: Fix cataloguing/value_builder/dateaccessioned.pl

Remove unnecessary call to event.preventDefault()

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Tomás Cohen Arazi (tcohen) 2023-04-24 13:49:10 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 12 Jacob O'Mara 2023-05-10 12:53:51 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.