Skip to content

Commit

Permalink
tweak(Sales) Document Position from Product fix localized string
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Mar 9, 2024
1 parent 67a44ad commit a691890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tine20/Sales/Model/Document/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ public function createPositionFromProduct(Sales_Model_Product $product, string $

$prodFlds = $product::getConfiguration()->fields;
foreach (array_diff(array_intersect($product::getConfiguration()->fieldKeys, $positionClass::getConfiguration()->fieldKeys), Tinebase_ModelConfiguration::$genericProperties) as $property) {
if ($prodFlds[$property][self::TYPE] === self::TYPE_LOCALIZED_STRING) {
if (($prodFlds[$property][self::CONFIG][self::SPECIAL_TYPE] ?? null) === self::TYPE_LOCALIZED_STRING) {
$position->{$property} = ($product->{$property}?->find(Tinebase_Record_PropertyLocalization::FLD_LANGUAGE, $lang)
?: $product->{$property}?->getFirstRecord())?->{Tinebase_Record_PropertyLocalization::FLD_TEXT};
} else {
Expand Down

0 comments on commit a691890

Please sign in to comment.