Bug 14956 - Remove C4::Dates from files opac/*.pl
Summary: Remove C4::Dates from files opac/*.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 14870
  Show dependency treegraph
 
Reported: 2015-10-05 12:34 UTC by Marc Véron
Modified: 2019-04-17 15:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 14956 - C4::Dates from files opac/*.pl (5.56 KB, patch)
2015-10-05 13:01 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14956 - C4::Dates from files opac/*.pl (6.62 KB, patch)
2015-10-12 19:16 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14956 - (follow) Prevent patrons to insert invalid dates in opac/opac-memberentry.pl (1.63 KB, patch)
2015-10-12 21:03 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 14956 - (follow) Prevent patrons to insert invalid dates in opac-memberentry.tt (1.88 KB, patch)
2015-10-12 21:27 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 14956 - (follow) Prevent patrons to insert invalid dates in opac-memberentry.tt (2.15 KB, patch)
2015-10-12 21:37 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14956 - (follow) Validate incoming birth date (1.09 KB, patch)
2015-10-14 18:01 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 14956 - C4::Dates from files opac/*.pl (6.69 KB, patch)
2015-11-04 05:16 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 14956 - (follow) Validate incoming birth date (1.18 KB, patch)
2015-11-04 05:16 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 14956: (followup) Fix birthday date validation in Opac (1.55 KB, patch)
2015-11-05 14:05 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 14956: (followup) Fix birthday date validation in Opac (1.66 KB, patch)
2015-11-06 03:09 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[PASSED QA] Bug 14956 - C4::Dates from files opac/*.pl (6.76 KB, patch)
2015-11-06 16:31 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[PASSED QA] Bug 14956: (followup) Fix birthday date validation in Opac (1.72 KB, patch)
2015-11-06 16:32 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 14957: Put database updates in perl script (8.96 KB, patch)
2019-04-17 15:36 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 14957: Add tests and pod for new options param to ModBiblio (6.38 KB, patch)
2019-04-17 15:36 UTC, David Gustafsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2015-10-05 12:34:17 UTC
C4::Dates from files:

-  opac/opac-memberentry.pl
-  opac/opac-reserve.pl
-  opac/opac-search-history.pl
-  opac/opac-showreviews.pl
-  opac/opac-suggestions.pl
-  opac/opac-serial-issues.pl

-  opac/opac-alert-subscribe.pl
-  opac/opac-ics.pl
Comment 1 Marc Véron 2015-10-05 13:01:15 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2015-10-12 17:26:30 UTC
Hi Marc

After applying patch I've found this:

/opac/opac-showreviews.pl got C4::Dates declaration in line 59, 116 and patch only eliminate the declaration 'use C4::Dates'

Regards
Comment 3 Marc Véron 2015-10-12 19:16:32 UTC Comment hidden (obsolete)
Comment 4 Héctor Eduardo Castro Avalos 2015-10-12 21:01:37 UTC
Hi Marc

When you go to "your personal details" (opac/opac-memberentry.pl) and if you alter to an invalid date the form it doesn't fail but when you go to staff in Home > Patrons requesting modifications, at the bottom of screen this redirect to members/members-update.pl and you get noticed that the date sent is '0000-00-00' (depends in which format you have dateformat syspref) this data shown in a table:

Field 		From 		To
Date of birth 	2015-11-01 	0000-00-00

To prevent this (IMHO) I suggest to add readonly="" to the input text or follow the example as koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt

Patch follow
Comment 5 Héctor Eduardo Castro Avalos 2015-10-12 21:03:59 UTC Comment hidden (obsolete)
Comment 6 Héctor Eduardo Castro Avalos 2015-10-12 21:27:23 UTC Comment hidden (obsolete)
Comment 7 Marc Véron 2015-10-12 21:37:28 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-10-13 11:19:44 UTC
The second patch is not the way to do, especially at the OPAC: if the user turned off JS, he cannot enter a date.
Comment 9 Marc Véron 2015-10-14 17:59:01 UTC
Comment on attachment 43362 [details] [review]
Bug 14956 - (follow) Prevent patrons to insert invalid dates in opac-memberentry.tt

Obsoleted this patch becaues of comment #8, replacment patch follows.
Comment 10 Marc Véron 2015-10-14 18:01:36 UTC Comment hidden (obsolete)
Comment 11 Marc Véron 2015-10-23 09:39:19 UTC
Still applies
Comment 12 Marc Véron 2015-10-29 14:09:36 UTC
Still applies
Comment 13 Héctor Eduardo Castro Avalos 2015-11-04 05:16:00 UTC Comment hidden (obsolete)
Comment 14 Héctor Eduardo Castro Avalos 2015-11-04 05:16:14 UTC Comment hidden (obsolete)
Comment 15 Héctor Eduardo Castro Avalos 2015-11-04 05:19:50 UTC
After long, long test, finally signed off
Comment 16 Jonathan Druart 2015-11-05 11:39:31 UTC
Define a date of birth at the opac, validate the changes.
Clear the date, go and see the changes: the new date is today.
Comment 17 Marc Véron 2015-11-05 14:05:46 UTC Comment hidden (obsolete)
Comment 18 Héctor Eduardo Castro Avalos 2015-11-06 03:09:37 UTC Comment hidden (obsolete)
Comment 19 Héctor Eduardo Castro Avalos 2015-11-06 03:19:15 UTC
Just one comment, Marc

The Patrons requesting modification (Home > Patrons > Update patron records) does not follow dateformat syspref.

file: members/members-update.pl
Comment 20 Marc Véron 2015-11-06 08:22:23 UTC
(In reply to Héctor Eduardo Castro Avalos from comment #19)
> Just one comment, Marc
> 
> The Patrons requesting modification (Home > Patrons > Update patron records)
> does not follow dateformat syspref.
> 
> file: members/members-update.pl

Thanks, Héctor, I filed Bug14956 (needs sign-off)
Comment 21 Marc Véron 2015-11-06 08:24:37 UTC
Sorry, mistaked: Bug 15146
(Need a double espresso)
Comment 22 Kyle M Hall (khall) 2015-11-06 16:31:56 UTC
Created attachment 44593 [details] [review]
[PASSED QA] Bug 14956 - C4::Dates from files opac/*.pl

Remove C4::Dates from files:
-  opac/opac-memberentry.pl
-  opac/opac-reserve.pl
-  opac/opac-search-history.pl
-  opac/opac-showreviews.pl
-  opac/opac-suggestions.pl
-  opac/opac-serial-issues.pl
-  opac/opac-alert-subscribe.pl
-  opac/opac-ics.pl

To test:
- Apply patch
- Verify, that self registration and holds work as before
- Verify that tabs in catalog item detail work and display
  as before
- For serials: Verify that subscriptions work as before. It is a
  little bit hidden, in tab Subscriptions, then 'More details', then
  tab 'Brief history', button 'Subscribe to email notificatin on
  new issues'
- For ics: Can not be tested at the moment, not yet used (Bug 5456),
  pls. have a look at the code changes

(Amended following comment #2)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Kyle M Hall (khall) 2015-11-06 16:32:05 UTC
Created attachment 44594 [details] [review]
[PASSED QA] Bug 14956: (followup) Fix birthday date validation in Opac

To reproduce / test:

- In Opac: Go to 'your personal details'
- Enter a valid birtday date
- In Staff client: Go to Home > Patrons > Update patron records
  (Link on start page: Patrons requesting modification)
- Verify that the birtday date is correct
- Back in Opac, clear the birthday date, try to submit
  => Validation message appears
- Enter an invalid date (32/32/2999 or 00/00/0000), try to submit
  => Birthday date field is cleared, validation message appears.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Wrong today corrected

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Tomás Cohen Arazi (tcohen) 2015-11-06 18:13:41 UTC
Patches pushed to master.

Thanks Marc!
Comment 25 David Gustafsson 2019-04-17 15:36:21 UTC
Created attachment 88203 [details] [review]
Bug 14957: Put database updates in perl script

Also add schema changes to kohastructure.sql and syspref to sysprefs.sql
Comment 26 David Gustafsson 2019-04-17 15:36:24 UTC
Created attachment 88204 [details] [review]
Bug 14957: Add tests and pod for new options param to ModBiblio
Comment 27 David Gustafsson 2019-04-17 15:42:31 UTC
Sorry about that, mistyped the bug-number.