Skip to content

Commit

Permalink
Fix EZP-23529: Storing a draft with a bad object relation link should…
Browse files Browse the repository at this point in the history
… not create an entry in ezcontentobject_link

Do not store the ezcontentobject_link entry if the object doesn't exist. (This does not change the behaviour of the draft storing/publishing process.)
  • Loading branch information
glye committed Oct 30, 2014
1 parent 3474f3c commit 913dc38
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kernel/classes/ezcontentobject.php
Expand Up @@ -2833,6 +2833,14 @@ function addContentObjectRelation( $toObjectID,
"eZContentObject::addContentObjectRelation" );
return false;
}

if ( !eZContentObject::exists( $toObjectID ) )
{
eZDebug::writeError( "Related object ID (toObjectID): '$toObjectID', does not refer to any existing object.",
"eZContentObject::addContentObjectRelation" );
return false;
}

$fromObjectID =(int) $fromObjectID;
$attributeID =(int) $attributeID;
$fromObjectVersion =(int) $fromObjectVersion;
Expand Down

0 comments on commit 913dc38

Please sign in to comment.