Skip to content

Commit

Permalink
Merge pull request #163 from ezsystems/ezp-22859-object_relations
Browse files Browse the repository at this point in the history
Fix EZP-22859: Object Relations versions not saved correctly in Solr
  • Loading branch information
yannickroger committed Jun 2, 2014
2 parents 8585286 + 4ed347b commit d79ebcd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/ezfsolrdocumentfieldobjectrelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,15 @@ public function getData()
$subObjectID = $relationItem['contentobject_id'];
if ( !$subObjectID )
continue;
$subObject = eZContentObjectVersion::fetchVersion( $relationItem['contentobject_version'], $subObjectID );

// Using last version of object (version inside xml data is the original version)
$subObject = eZContentObject::fetch( $subObjectID );

if ( !$subObject || $relationItem['in_trash'] )
continue;

// 1st create aggregated metadata fields
$metaAttributeValues = eZSolr::getMetaAttributesForObject( $subObject->attribute( 'contentobject' ) );
$metaAttributeValues = eZSolr::getMetaAttributesForObject( $subObject );
foreach ( $metaAttributeValues as $metaInfo )
{
$submetaFieldName = ezfSolrDocumentFieldBase::generateSubmetaFieldName( $metaInfo['name'], $contentClassAttribute );
Expand Down

0 comments on commit d79ebcd

Please sign in to comment.