On Fri, Jul 13, 2012 at 3:59 PM, Uriel <uriel.liz...@gmail.com> wrote:
> Whenever I create a new object and save it, it saves the object correctly on
> the database but then it dies with the following error:
> "Could not parse datetime 'now' - Invalid date format: now"
> This is really strange, since it does save the object with the correct date
> on the database.
> Any pointers on what might be the problem?
Nothing comes to mind. It looks like "now" is making it past the
first level of parsing by Rose::DateTime::Util's parse_date() method
(which does understand "now") and to the per-database date parsing
code, which probably doesn't. But I don't see why that would happen.
I suggest stepping through the problematic code in the debugger to see
what's going on. Failing that, make a self-contained test case that
anyone can run and post it to the list.
> Whenever I create a new object and save it, it saves the object
> correctly on the database but then it dies with the following error:
> "Could not parse datetime 'now' - Invalid date format: now"
> This is really strange, since it does save the object with the correct
> date on the database.
> Any pointers on what might be the problem?
You're not being bitten by a misuse of the $db->error 'feature'?
$db->do_transaction( sub { ... } );
return $db->error if $db->error; # THIS IS WRONG
That bites in a persistent environment. I'm sure John will fill in the details, but it's returning a silent warning stored during an earlier date-handling instance.
On Sat, Jul 14, 2012 at 4:28 AM, Richard Jones <ra.jo...@dpw.clara.co.uk> wrote:
> You're not being bitten by a misuse of the $db->error 'feature'?
> $db->do_transaction( sub { ... } );
> return $db->error if $db->error; # THIS IS WRONG
> That bites in a persistent environment. I'm sure John will fill in the
> details, but it's returning a silent warning stored during an earlier
> date-handling instance.
On Saturday, July 14, 2012 3:28:00 AM UTC-5, Richard Jones wrote:
> On 13/07/2012 20:59, Uriel wrote: > [..] > > Whenever I create a new object and save it, it saves the object > > correctly on the database but then it dies with the following error:
> > "Could not parse datetime 'now' - Invalid date format: now"
> > This is really strange, since it does save the object with the correct > > date on the database.
> > Any pointers on what might be the problem?
> You're not being bitten by a misuse of the $db->error 'feature'?
> $db->do_transaction( sub { ... } ); > return $db->error if $db->error; # THIS IS WRONG
> That bites in a persistent environment. I'm sure John will fill in the > details, but it's returning a silent warning stored during an earlier > date-handling instance.