6.0.0-alpha10
5/14/25

Search Results: 10 of 16 [ <<First <Prev Next> Last>> ] [ Return to Search Results ]


[#14803] Horde_Rdo_Mapper sets created_at, forgets updated_at
Summary Horde_Rdo_Mapper sets created_at, forgets updated_at
Queue Horde Framework Packages
Type Bug
State Feedback
Priority 1. Low
Owners
Requester birnbacs (at) gmail (dot) com
Created 04/03/2018 (2598 days ago)
Due 05/01/2018 (2570 days ago)
Updated 04/07/2019 (2229 days ago)
Assigned 04/07/2019 (2229 days ago)
Resolved
Milestone
Patch No

History
04/07/2019 12:25:33 AM Michael Rubinsky State ⇒ Feedback
 
04/07/2019 12:25:26 AM Michael Rubinsky Comment #5 Reply to this comment
I am surprised the bug is still open. Please kindly see enclosed 
file for a fix for both problems. The amended lines are marked with 
this ticket's number 14803
Wouldn't this depend on the column type you created in the database?

Not saying it shouldn't be a datetime, but changing this to *assume* 
it's a datetime field is a BC break.
04/05/2019 01:23:01 PM birnbacs (at) gmail (dot) com Comment #4
New Attachment: Mapper[1].php Download
Reply to this comment
I am surprised the bug is still open. Please kindly see enclosed file 
for a fix for both problems. The amended lines are marked with this 
ticket's number 14803
04/23/2018 09:03:44 PM birnbacs (at) gmail (dot) com Comment #3 Reply to this comment
I found another little bug in Mapper.php. Function create (line 343 
ff.) should also use the Horde_Date object:

     public function create($fields)
     {
         // If configured to record creation and update times, set them
         // here. We set updated_at to the initial creation time so it's
         // always set.
         if ($this->_setTimestamps) {
             $time = time();
             $fields['created_at'] = new Horde_Date(time()); //$time;
             $fields['updated_at'] = new Horde_Date(time()); //$time;
         }
04/13/2018 09:59:27 AM birnbacs (at) gmail (dot) com Comment #2
New Attachment: Mapper.php Download
Reply to this comment
I was able to fix the described misbehaviour.
Please note the change around line 408 of enclosed Mapper.php:

[...]
         // If configured to record update time, set it here.
         if ($this->_setTimestamps) {
             //$fields['updated_at'] = time();
             $fields['updated_at'] = new Horde_Date(time());
         }
[...]

04/03/2018 10:42:18 PM birnbacs (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Horde_Rdo_Mapper sets created_at, forgets updated_at
Due ⇒ 05/01/2018
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
I am using an RdoMapper on a table created with $t->timestamps() on a 
Horde_Db_Migration_Base object. Columns created_at and updated_at are 
created right away in the backend.

According to Mapper.php (line 342 ff.), both fields should be set to 
the current timestamp on create(). According to lines 388 ff. 
updated_at should be set on update(). While created_at functions all 
right, updated_at remains set to 0000-00-00 00:00:00. No change on 
creation or update.

Saved Queries