Commit | Line | Data |
75d07914 |
1 | package # hide from PAUSE |
c0e7b4e5 |
2 | DBIx::Class::Componentised; |
227d4dee |
3 | |
bf5ecff9 |
4 | use strict; |
5 | use warnings; |
6 | |
48a76fcf |
7 | use base 'Class::C3::Componentised'; |
d38cd95c |
8 | use Carp::Clan qw/^DBIx::Class|^Class::C3::Componentised/; |
9 | use mro 'c3'; |
10 | |
11 | # this warns of subtle bugs introduced by UTF8Columns hacky handling of store_column |
12 | sub inject_base { |
13 | my $class = shift; |
14 | my $target = shift; |
15 | |
16 | my @present_components = (@{mro::get_linear_isa ($target)||[]}); |
17 | |
18 | no strict 'refs'; |
19 | for my $comp (reverse @_) { |
20 | if ( |
21 | $comp->isa ('DBIx::Class::UTF8Columns') |
22 | and |
23 | my @broken = grep { $_ ne 'DBIx::Class::Row' and defined ${"${_}::"}{store_column} } (@present_components) |
24 | ) { |
25 | carp "Incorrect loading order of $comp by ${target} will affect other components overriding store_column (" |
26 | . join (', ', @broken) |
27 | .'). Refer to the documentation of DBIx::Class::UTF8Columns for more info'; |
28 | } |
29 | else { |
30 | unshift @present_components, $comp; |
31 | } |
32 | } |
33 | |
34 | $class->next::method($target, @_); |
35 | } |
efe6365b |
36 | |
227d4dee |
37 | 1; |