Bug 31665 - 952$d ( Date acquired ) no longer prefills with todays date when focused
Summary: 952$d ( Date acquired ) no longer prefills with todays date when focused
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor with 10 votes (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-09-30 15:12 UTC by Lucas Gass
Modified: 2023-12-28 20:44 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04


Attachments
Bug 31665: Set today date for date cataloguing plugin (1.61 KB, patch)
2023-02-01 09:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 31665: Set today date for date cataloguing plugin (1.66 KB, patch)
2023-02-01 22:40 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 31665: Set today date for date cataloguing plugin (1.71 KB, patch)
2023-02-01 23:01 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 31665: Set today date for date cataloguing plugin (1.76 KB, patch)
2023-03-03 18:00 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2022-09-30 15:12:24 UTC
Before the introduction of Flatpickr, when adding a new item if you clicked on the date acquired field, and it was empty, it would be prefilled with today's date. 

It would be useful if we could get that functionality back.
Comment 1 Marcel de Rooy 2022-10-04 12:09:37 UTC
I am seeing this in 21.11 too.
Note that it is about focus of the text box. Clicking on the plugin control next to the text box does still update the field.
Comment 2 Marcel de Rooy 2022-10-04 12:10:52 UTC
When you focus the field, the date popup comes up. If that would respond to Enter, it would already be helpful?
Comment 3 Marcel de Rooy 2022-10-04 12:21:14 UTC
How to categorize this bug might be hard too: If lots of items would not get a date anymore, a library might not consider this Minor anymore
Comment 4 Katrin Fischer 2022-10-04 20:36:23 UTC
(In reply to Marcel de Rooy from comment #3)
> How to categorize this bug might be hard too: If lots of items would not get
> a date anymore, a library might not consider this Minor anymore

Today's date is used autommagically when you leave the input empty. So that won't be the case, but I also liked the old behaviour as it allowed easy manipulation of the date.
Comment 5 Marcel de Rooy 2022-10-05 11:10:54 UTC
(In reply to Katrin Fischer from comment #4)
> (In reply to Marcel de Rooy from comment #3)
> > How to categorize this bug might be hard too: If lots of items would not get
> > a date anymore, a library might not consider this Minor anymore
> 
> Today's date is used autommagically when you leave the input empty. So that
> won't be the case, but I also liked the old behaviour as it allowed easy
> manipulation of the date.

That is depending on the context. You are right for new items. Which will be the scope mainly here.
For existing items, see bug 29958: Do not set dateaccessioned on updates
Comment 6 Fridolin Somers 2022-10-07 20:04:39 UTC
Could this be related to Bug 30797 ?
Comment 7 Lucas Gass 2023-01-09 21:04:43 UTC
Looking back at 21.05.x I see that this works with via the dateaccessioned.pl plugin. In the dateaccessioned.pl code there is this event handler:

function Focus$function_name(event) {
    set_to_today(event.data.id);
}


Looking at master now I see that the event handler is still there on the 'tag_952_subfield_d_' element but has an input type of 'type="hidden"'. That is being hidden by flatpickr, so the event needs to be attached to the Flatpickr wrapper.
Comment 8 Jonathan Druart 2023-02-01 09:49:55 UTC
Created attachment 145923 [details] [review]
Bug 31665: Set today date for date cataloguing plugin

dateaccessioned.pl must pick today's date when the input gets the focus
on.

Test plan:
Edit an item, or create a new one.
Confirm that today's date is prefilled into the date's input when it's
empty and that it gets the focus on
Comment 9 Jonathan Druart 2023-02-01 09:51:40 UTC
I am really hesitant here, didn't we decide to not prefill it?

See bug 29963.
Comment 10 Jonathan Druart 2023-02-01 09:53:22 UTC
(In reply to Jonathan Druart from comment #9)
> I am really hesitant here, didn't we decide to not prefill it?
> 
> See bug 29963.

Ok, got it. This is about the focus. Then I think the patch is correct.
Comment 11 Lucas Gass 2023-02-01 22:40:26 UTC
Created attachment 145979 [details] [review]
Bug 31665: Set today date for date cataloguing plugin

dateaccessioned.pl must pick today's date when the input gets the focus
on.

Test plan:
Edit an item, or create a new one.
Confirm that today's date is prefilled into the date's input when it's
empty and that it gets the focus on

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 12 ByWater Sandboxes 2023-02-01 23:01:05 UTC
Created attachment 145981 [details] [review]
Bug 31665: Set today date for date cataloguing plugin

dateaccessioned.pl must pick today's date when the input gets the focus
on.

Test plan:
Edit an item, or create a new one.
Confirm that today's date is prefilled into the date's input when it's
empty and that it gets the focus on

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Comment 13 Nick Clemens 2023-03-03 18:00:55 UTC
Created attachment 147721 [details] [review]
Bug 31665: Set today date for date cataloguing plugin

dateaccessioned.pl must pick today's date when the input gets the focus
on.

Test plan:
Edit an item, or create a new one.
Confirm that today's date is prefilled into the date's input when it's
empty and that it gets the focus on

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 14 Tomás Cohen Arazi 2023-03-06 12:48:54 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 15 Jacob O'Mara 2023-03-07 18:27:47 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 16 Lucas Gass 2023-03-10 17:24:54 UTC
Won't apply cleanly to 22.05, no backport