@@ -75,7 +75,11 @@ public function listCustomFields(): Response
7575 ->filterBySource ('general ' )
7676 ->findOne ();
7777
78- if ($ value && in_array ($ customField ->getType (), CustomFieldValueController::CUSTOM_FIELD_SIMPLE_VALUES )) {
78+ if (
79+ $ value &&
80+ (in_array ($ customField ->getType (), CustomFieldValueController::CUSTOM_FIELD_SIMPLE_VALUES )
81+ || !$ customField ->getIsInternational ())
82+ ) {
7983 $ generalValues [$ customField ->getId ()] = $ value ->getSimpleValue () ?? '' ;
8084 $ generalValueIds [$ customField ->getId ()] = $ value ->getId ();
8185 } elseif ($ value ) {
@@ -112,7 +116,9 @@ public function createCustomField(): Response
112116 // Get all parents for the dropdown
113117 $ parents = CustomFieldParentQuery::create ()->find ();
114118
115- $ form = $ this ->createForm (CustomFieldForm::getName ());
119+ $ form = $ this ->createForm (CustomFieldForm::getName (), FormType::class, [
120+ 'is_international ' => true ,
121+ ]);
116122 $ this ->getParserContext ()->addForm ($ form );
117123 $ error = null ;
118124
@@ -176,6 +182,7 @@ public function updateCustomField(int $id): Response
176182 'title ' => $ customField ->getTitle (),
177183 'code ' => $ customField ->getCode (),
178184 'type ' => $ customField ->getType (),
185+ 'is_international ' => $ customField ->getIsInternational (),
179186 'sources ' => $ sourcesArray ,
180187 'custom_field_parent_id ' => $ customField ->getCustomFieldParentId (),
181188 ]);
@@ -228,6 +235,7 @@ private function handleSave(Form $validatedForm, ?CustomField $customField = nul
228235 ->setTitle ($ validatedForm ->get ('title ' )->getData ())
229236 ->setCode ($ validatedForm ->get ('code ' )->getData ())
230237 ->setType ($ validatedForm ->get ('type ' )->getData ())
238+ ->setIsInternational ($ validatedForm ->get ('is_international ' )->getData ())
231239 ->setCustomFieldParentId ($ parentId ?: null )
232240 ->save ();
233241
0 commit comments