Fix infinite loop problems with inheritUrlFromParent
This commit is contained in:
parent
1ce5e4ebab
commit
1f44e63af2
1 changed files with 9 additions and 6 deletions
|
|
@ -159,7 +159,7 @@ property extraHeadTags => (
|
||||||
default => undef,
|
default => undef,
|
||||||
customDrawMethod=> 'drawExtraHeadTags',
|
customDrawMethod=> 'drawExtraHeadTags',
|
||||||
);
|
);
|
||||||
after extraHeadTags => sub {
|
around extraHeadTags => sub {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
if (@_ > 1) {
|
if (@_ > 1) {
|
||||||
my $unpacked = $_[0];
|
my $unpacked = $_[0];
|
||||||
|
|
@ -218,10 +218,13 @@ property inheritUrlFromParent => (
|
||||||
fieldType => 'yesNo',
|
fieldType => 'yesNo',
|
||||||
default => 0,
|
default => 0,
|
||||||
);
|
);
|
||||||
after inheritUrlFromParent => sub {
|
around inheritUrlFromParent => sub {
|
||||||
|
my $orig = shift;
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return unless $self->inheritUrlFromParent;
|
$self->$orig(@_);
|
||||||
$self->url($self->url);
|
if (@_ > 0 && $_[0]) {
|
||||||
|
$self->url($self->url);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
property status => (
|
property status => (
|
||||||
noFormPost => 1,
|
noFormPost => 1,
|
||||||
|
|
@ -284,7 +287,7 @@ around BUILDARGS => sub {
|
||||||
$revisionDate = $className->getCurrentRevisionDate( $session, $assetId );
|
$revisionDate = $className->getCurrentRevisionDate( $session, $assetId );
|
||||||
return undef unless $revisionDate;
|
return undef unless $revisionDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $properties = eval{$session->cache->get(["asset",$assetId,$revisionDate])};
|
my $properties = eval{$session->cache->get(["asset",$assetId,$revisionDate])};
|
||||||
unless (exists $properties->{assetId}) { # can we get it from cache?
|
unless (exists $properties->{assetId}) { # can we get it from cache?
|
||||||
my $sql = "select * from asset";
|
my $sql = "select * from asset";
|
||||||
|
|
@ -2351,7 +2354,7 @@ sub write {
|
||||||
##Write them to the db.
|
##Write them to the db.
|
||||||
my $db = $self->session->db;
|
my $db = $self->session->db;
|
||||||
CLASS: foreach my $meta (reverse $self->meta->get_all_class_metas()) {
|
CLASS: foreach my $meta (reverse $self->meta->get_all_class_metas()) {
|
||||||
my $table = $db->quote_identifier($meta->tableName);
|
my $table = $db->quoteIdentifier($meta->tableName);
|
||||||
my @properties = $meta->get_property_list;
|
my @properties = $meta->get_property_list;
|
||||||
my @values = map { $self->$_ } @properties;
|
my @values = map { $self->$_ } @properties;
|
||||||
my @columnNames = map { $db->quote_identifier($_).'=?' } @properties;
|
my @columnNames = map { $db->quote_identifier($_).'=?' } @properties;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue