
david at kineticode
Jan 12, 2009, 12:50 PM
Post #2 of 2
(885 views)
Permalink
|
On Jan 12, 2009, at 12:44 PM, Kahil Jallad wrote: > Hello all, > > When trying to “View Diff” on templates in 1.11 I was getting: > [Mon Jan 12 19:29:11 2009] [error] [client 192.168.1.101] Invalid > property 'Limit'., > [/bricolage/lib/Bric/Util/Event.pm:1482] > [/bricolage/lib/Bric/Util/Event.pm:391] > … > The small attached patch seems to have fixed it. God. Dunno who wrote that, but it's awful. This patch is better. Index: Event.pm =================================================================== --- Event.pm (revision 8399) +++ Event.pm (working copy) @@ -1406,16 +1406,14 @@ $order_by .= ' ' . delete $params->{OrderDirection} if $params->{OrderDirection}; } - my $limit = LIMIT_DEFAULT if (exists $params->{Offset}); - $limit = (exists $params->{Limit}) - ? delete $params->{Limit} - : '' if !$limit; - ; - $limit = 'LIMIT ' . $limit if $limit ne ''; - my $offset = exists $params->{Offset} + + my $limit = exists $params->{Limit} ? 'LIMIT ' . delete $params- >{Limit} + : exists $params->{Offset} ? 'LIMIT ' . LIMIT_DEFAULT + : ''; + + my $offset = exists $params->{Offset} ? 'OFFSET ' . delete $params->{Offset} - : '' - ; + : ''; while (my ($k, $v) = each %$params) { if ($k eq 'timestamp') { > I was also getting SQL errors from line 318 of Event.pm, trying to > save an event with a null obj_id, this was while I was messing > around with the conversion from 1.10 so I might have had bad data in > the DB or something – if I can re-create and verify the problem I’ll > post something. Yes, please do. Best, David
|