From a91b6d446e8f6165eabdaeec6f01044988df248a Mon Sep 17 00:00:00 2001 From: unitm-klas <47173230+unitm-klas@users.noreply.github.com> Date: Fri, 11 Oct 2019 10:40:56 +0200 Subject: [PATCH] Fix installer for MetaInformation Fields This relation creation silently fails due to the confusion between target and owning tables. Column names need to come from actual target, not from wrongly named variable having owning side table loaded. P.S. This pull fixes installer, but also a fix for existing installations with additional migration is needed. --- .../Migrations/Schema/OroSEOBundleInstaller.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Oro/Bundle/SEOBundle/Migrations/Schema/OroSEOBundleInstaller.php b/src/Oro/Bundle/SEOBundle/Migrations/Schema/OroSEOBundleInstaller.php index edf5046a504..887f23bb2ff 100644 --- a/src/Oro/Bundle/SEOBundle/Migrations/Schema/OroSEOBundleInstaller.php +++ b/src/Oro/Bundle/SEOBundle/Migrations/Schema/OroSEOBundleInstaller.php @@ -82,8 +82,9 @@ private function addMetaInformation(Schema $schema, $ownerTable) */ private function addMetaInformationField(Schema $schema, $ownerTable, $relationName, $isString = false) { - $targetTable = $schema->getTable($ownerTable); - + $ownerTable = $schema->getTable($ownerTable); + $targetTable = $schema->getTable(self::FALLBACK_LOCALE_VALUE_TABLE_NAME); + // Column names are used to show a title of target entity $targetTitleColumnNames = $targetTable->getPrimaryKeyColumns(); // Column names are used to show detailed info about target entity @@ -93,9 +94,9 @@ private function addMetaInformationField(Schema $schema, $ownerTable, $relationN $this->extendExtension->addManyToManyRelation( $schema, - $targetTable, + $ownerTable, $relationName, - self::FALLBACK_LOCALE_VALUE_TABLE_NAME, + $targetTable, $targetTitleColumnNames, $targetDetailedColumnNames, $targetGridColumnNames,