Skip to content

Commit

Permalink
- Fixed bug #6571: Object relations list crash.
Browse files Browse the repository at this point in the history
  (Manually merged from trunk rev. 11693)


git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/stable/3.5@11712 a01eee8c-daba-0310-acae-fa49f3023285
  • Loading branch information
Raymond Bosman committed May 6, 2005
1 parent e4e399e commit 328762a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/changelogs/3.5/CHANGELOG-3.5.2-to-3.5.3
Expand Up @@ -56,6 +56,9 @@ Attributes:
(Merged from stable/3.4 (3.4.7) rev. 11692)
- Fixed bug #5843: Invalid locale values can be added to content/translations.
(Merged from stable/3.4 (3.4.7) rev. 11696)
- Fixed bug #6571: Object relations list crash.
(Manually merged from trunk rev. 11693)


*WebDAV:

Expand Down
Expand Up @@ -746,6 +746,15 @@ function customObjectAttributeHTTPAction( $http, $action, &$contentObjectAttribu

foreach ( $selectedObjectIDArray as $objectID )
{
// Check if the given object ID has a numeric value, if not go to the next object.
if ( !is_numeric( $objectID ) )
{
eZDebug::writeError( "Related object ID (objectID): '$objectID', is not a numeric value.",
"eZObjectRelationListType::customObjectAttributeHTTPAction" );

continue;
}

/* Here we check if current object is already in the related objects list.
* If so, we don't add it again.
* FIXME: Stupid linear search. Maybe there's some better way?
Expand Down
8 changes: 8 additions & 0 deletions kernel/classes/ezcontentobject.php
Expand Up @@ -1743,6 +1743,14 @@ function setCurrentLanguage( $lang )
function addContentObjectRelation( $objectID, $version )
{
$db =& eZDB::instance();

if ( !is_numeric( $objectID ) )
{
eZDebug::writeError( "Related object ID (objectID): '$objectID', is not a numeric value.",
"eZContentObject::addContentObjectRelation" );
return false;
}

$db->query( "INSERT INTO ezcontentobject_link ( from_contentobject_id, from_contentobject_version, to_contentobject_id )
VALUES ( '$this->ID', '$version', '$objectID' )" );
}
Expand Down

0 comments on commit 328762a

Please sign in to comment.