Skip to content

Commit

Permalink
[Bug]: Call to undefined method when using a "load DataObject" pipeli…
Browse files Browse the repository at this point in the history
…ne (#272)

* fixed loadBy attribute issue

Co-authored-by: Alexander Scheider <[email protected]>

* Apply php-cs-fixer changes

Co-authored-by: Alexander Scheider <[email protected]>
Co-authored-by: Corepex <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2022
1 parent 4db1b84 commit 91a98cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Mapping/Type/TransformationDataTypeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ public function getPimcoreDataTypes(string $classId, $transformationTargetType,
'title' => 'SYSTEM Key',
'localized' => false
];
$attributes['fullpath'] = [
'key' => 'fullpath',
$attributes['path'] = [
'key' => 'path',
'title' => 'SYSTEM Fullpath',
'localized' => false
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pimcore.plugin.pimcoreDataImporterBundle.configuration.components.mapping.operat
}
});

const systemAttributes = ['id', 'fullpath', 'key'];
const systemAttributes = ['id', 'path', 'key'];

const partialMatch = Ext.create('Ext.form.field.Checkbox', {
fieldLabel: t('plugin_pimcore_datahub_data_importer_configpanel_transformation_pipeline_accept_partial_match'),
Expand Down
8 changes: 7 additions & 1 deletion src/Tool/DataObjectLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ public function loadByAttribute(string $className,
if (empty($attributeLanguage) === false) {
$element = $className::$getter($identifier, $attributeLanguage, $limit, 0, $objectTypes);
} else {
$element = $className::$getter($identifier, $limit, 0, $objectTypes);
if (method_exists($className, $getter)) {
$element = $className::$getter($identifier);
}

if (!$element) {
$element = $className::$getter($identifier, $limit, 0, $objectTypes);
}
}
} else {
$queryFieldName = $attributeName;
Expand Down

0 comments on commit 91a98cf

Please sign in to comment.