Skip to content

Commit

Permalink
Fix EZP-22859: Object Relations versions not saved correctly in Solr
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickroger committed May 30, 2014
1 parent 482e6b8 commit 4ed347b
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 4ed347b

Please sign in to comment.