On Mon, May 10, 2010 at 11:11 AM, Miquel Ruiz <[email protected]> wrote: > On 07/05/2010 18:39, luke saunders wrote: >> >> The test case you sent me offlist is now fixed in svn. That test case >> doesn't mention DynamicSubclass but I presume that it's the same >> problem. Can you check the latest revision from svn* and confirm if >> the original issue is also fixed? > > The Preview component is now working fine, but still getting errors when > using it together with DynamicSubclass. > > I guess this is a problem related with how the DynamicSubclass handles the > reblessing stuff, not related with Preview.
So quick summary of the issue: DBIx::Class::Preview works by creating a new source for each previewed source and setting the result class of the previewed source to be a $class::preview which has some additional columns. DBIx::Class::DynamicSubclass works by changing the result class to be a different class, and this stomps on any changes to the result class that may have occurred previously, including the ones that ::Preview makes. This can be fixed by altering the classify method of DBIx::Class::DynamicSubclass to inject the old result class into the inheritance of the new one. I can do this by adding this inject_base line here: http://paste.scsys.co.uk/43353 and then it seems to work fine. The question is, does this sound like a sane fix? _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
