[Dbix-class] DynamicSubclass and Preview: conflict?

luke saunders luke.saunders at gmail.com
Mon May 10 14:49:52 GMT 2010

On Mon, May 10, 2010 at 11:11 AM, Miquel Ruiz <m.ruiz85 at gmail.com> 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

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

The question is, does this sound like a sane fix?

More information about the DBIx-Class mailing list