Skip to content

Commit 668e3e9

Browse files
johnorourkeinsanityinside
authored andcommitted
Fix for ProductLink - setterName was incorrectly being set to an ucfirst instead of converting to camel case, which doesn't work for models with underscores
1 parent a04f913 commit 668e3e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Model/ProductLink/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function getList(\Magento\Catalog\Api\Data\ProductInterface $product)
170170
foreach ($item['custom_attributes'] as $option) {
171171
$name = $option['attribute_code'];
172172
$value = $option['value'];
173-
$setterName = 'set'.ucfirst($name);
173+
$setterName = 'set'.str_replace('_', '', ucwords($name, '_'));
174174
// Check if setter exists
175175
if (method_exists($productLinkExtension, $setterName)) {
176176
call_user_func([$productLinkExtension, $setterName], $value);

0 commit comments

Comments
 (0)