closed date editor shows all closed dates as today

Bug #1320048 reported by Galen Charlton
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned

Bug Description

Existing closed days in the closed dates editor all display their start and end dates as the current date.

This appears to be a consequence of the patch for bug 1187035. By switching switching various open-ils.actor methods for handling closed dates from using OpenILS::Utils::Editor to using CStoreEditor, the format of dates returned by those methods changed from (e.g.)

  2013-09-02 23:59:59-04

to

  2013-09-02T23:59:59-0400

The change in date format does not play well with the Date.W3CDTF JavaScript library used by the closed dates editor to format the dates for display.

As it happens, Date.W3CDTF appears to be used /only/ by the closed dates editor, so switching to util.date will let us both fix the bug and get rid of a bit of dead code.

Evergreen 2.6

Revision history for this message
Galen Charlton (gmc) wrote :

A three-patch series to fix the bug and remove the Date.W3CDTF Javascript module is available at the tip of the user/gmcharlt/lp1320048_closed_dates_editor branch in the working/Evergreen repository:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/gmcharlt/lp1320048_closed_dates_editor

Changed in evergreen:
milestone: none → 2.6.1
tags: added: pullrequest staffclient
Changed in evergreen:
importance: Undecided → High
Revision history for this message
Galen Charlton (gmc) wrote :

if anybody looked at the branch right away, I just force-pushed to it to fix an erratum.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I applied the latest code in that branch, the 3 commits to production this morning because a library called that their 7-day items have the wrong due date. When I went to edit the closed dates, I saw the above behavior.

When I try to add a closed date, I get a database query error message. I'll add the postgresql log information later. Right now, I want to get the closed dates added properly, first.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Here's what's in my postgresql.main.log:

2014-05-17 10:47:58 EDT ERROR: invalid input syntax for type timestamp with time zone: "%{iso8601}" at character 86
2014-05-17 10:47:58 EDT STATEMENT: INSERT INTO actor.org_unit_closed (close_end,close_start,id,org_unit,reason) VALUES ('%{iso8601}','%{iso8601}',DEFAULT,2,'Memorial Day (This is a tes).');
2014-05-17 10:47:58 EDT ERROR: current transaction is aborted, commands ignored until end of transaction block

I tried it again after restarting the client. I only cleared the cache after copying the files the first time.

Revision history for this message
Galen Charlton (gmc) wrote :

Thanks for testing, Jason. I've force-pushed a corrected patch series to the working branch; I'd missed that Dojo needs to be initialized in order for util.date.formatted_date to recognize the %{iso8601} date format, and there was a flaw in my setup that meant that I didn't catch this during testing.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Thanks for the quick turnaround, Galen. I've tested the changes and they work for me.

Pushed to master and to rel_2_6.

Thanks, Galen!

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.