From: Boris Z. <bz...@2b...> - 2004-05-13 18:34:19
|
Hi Pieter, this is not a bug, $default_code_perl_sub should be called before the page_sub itself. Look here: http://pagekit.org/guide/re15.html Am Donnerstag, 13. Mai 2004 19:38 schrieb pdu...@so...: > Hi, > > Please take a look at line 968 of PageKit.pm: > > 966: $default_code_perl_sub = undef unless (defined > &$default_code_perl_sub); > > 967: > > 968: my @subs = grep { $_ } ( $default_code_perl_sub, $pk->page_sub ); > > 969: return $pk->call_model_code(@subs) if (@subs); > > Spotted it? ;-) > > Here's the bug described in <perl> > if ($default_code_perl_sub eg $pk->page_sub) { > > # @subs == ($default_code_perl_sub, $default_code_perl_sub), > # which means the model code for $default_code_perl_sub will be > # run twice! > > } > </perl> > > I suggest changing line 968 to: > > 968: my @subs = grep { $_ } ( $pk->page_sub ) || ( $default_code_perl_sub > ); > > This bug is potentially quite nasty, if some of the > following is done in the default code: > - state keeping > - logging > - db-write actions like updates, inserts and deletes. > > cu > -- > Pieter > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Pagekit-devel mailing list > Pag...@li... > https://lists.sourceforge.net/lists/listinfo/pagekit-devel -- Boris |