1 package # hide from PAUSE
2 DBIx::Class::Componentised;
7 use base 'Class::C3::Componentised';
8 use Carp::Clan qw/^DBIx::Class|^Class::C3::Componentised/;
11 # this warns of subtle bugs introduced by UTF8Columns hacky handling of store_column
12 # if and only if it is placed before something overriding store_column
15 my ($target, @complist) = @_;
17 # we already did load the component
18 my $keep_checking = ! $target->isa ('DBIx::Class::UTF8Columns');
20 my @target_isa = do { no strict 'refs'; @{"$target\::ISA"} };
21 my $base_store_column;
23 while ($keep_checking && @complist) {
25 my $comp = pop @complist;
27 if ($comp->isa ('DBIx::Class::UTF8Columns')) {
31 $base_store_column ||=
32 do { require DBIx::Class::Row; DBIx::Class::Row->can ('store_column') };
35 for my $existing_comp (@target_isa) {
36 my $sc = $existing_comp->can ('store_column')
39 if ($sc ne $base_store_column) {
41 my $definer = B::svref_2object($sc)->STASH->NAME;
42 push @broken, ($definer eq $existing_comp)
44 : "$existing_comp (via $definer)"
49 carp "Incorrect loading order of $comp by $target will affect other components overriding 'store_column' ("
50 . join (', ', @broken)
51 .'). Refer to the documentation of DBIx::Class::UTF8Columns for more info'
55 unshift @target_isa, $comp;
58 $class->next::method(@_);