Skip to content

Commit

Permalink
Merge pull request PrestaShop#36914 from Codencode/discussion-36897-p…
Browse files Browse the repository at this point in the history
…roblem-with-customizationfield-is_module

Added management of the 'addedByModule' field in the "CustomizationField" object
  • Loading branch information
Hlavtox authored Sep 20, 2024
2 parents 346f82e + 5649df1 commit 7f8c1d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function buildCustomizationFields(array $customizationsFormData): array
'type' => (int) $customization['type'],
'localized_names' => $customization['name'],
'is_required' => (bool) $customization['required'],
'added_by_module' => false,
'added_by_module' => isset($customization['addedByModule']) ? (bool) $customization['addedByModule'] : false,
'id' => isset($customization['id']) ? (int) $customization['id'] : null,
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ private function extractCustomizationsData(ProductForEditing $productForEditing,
'name' => $customizationField->getLocalizedNames(),
'type' => $customizationField->getType(),
'required' => $customizationField->isRequired(),
'addedByModule' => $customizationField->isAddedByModule(),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1008,12 +1008,14 @@ private function getDatasetsForCustomizations(): array
'name' => $localizedNames,
'type' => 1,
'required' => false,
'addedByModule' => false,
],
[
'id' => 2,
'name' => $localizedNames,
'type' => 0,
'required' => true,
'addedByModule' => false,
],
],
];
Expand All @@ -1024,12 +1026,14 @@ private function getDatasetsForCustomizations(): array
'name' => $localizedNames,
'type' => CustomizationFieldType::TYPE_TEXT,
'required' => false,
'addedByModule' => false,
],
[
'id' => 2,
'name' => $localizedNames,
'type' => CustomizationFieldType::TYPE_FILE,
'required' => true,
'addedByModule' => false,
],
];

Expand Down

0 comments on commit 7f8c1d4

Please sign in to comment.