Fixing lineage length bug

This commit is contained in:
Martin Kamerbeek 2006-10-13 14:17:08 +00:00
parent d0ef4e92db
commit dc5d96dd5b
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,7 @@
- fix: Snippet Security Fails
- add: asset exporter making appropriate symlinks for extras, uploads, and root URL
- change: asset exporter now uses one session per asset to avoid breaking state in between
- fix: Lineage length is not checked (Martin Kamerbeek / Procolix)
7.1.0
- fix: mysql and mysqldump were transposed in upgrade.pl --help

View file

@ -65,6 +65,11 @@ sub addChild {
$properties->{groupIdView} ||= '7';
$properties->{styleTemplateId} ||= 'PBtmpl0000000000000060';
# Check if it is possible to add a child to this asset. If not add it as a sibling of this asset.
if (length($self->get("lineage")) >= 252) {
$self->session->errorHandler->warn('Tried to add child to asset "'.$self->getId.'" which is already on the deepest level. Adding it as a sibling instead.');
return $self->getParent->addChild($properties, $id, $now);
}
my $lineage = $self->get("lineage").$self->getNextChildRank;
$self->{_hasChildren} = 1;
$self->session->db->beginTransaction;