Skip to content

Commit 6069ee6

Browse files
authored
Fix(Fields): fix target when more than one container is used (#3564)
1 parent 580eba5 commit 6069ee6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

inc/abstracttarget.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,15 @@ protected function appendFieldsData(array $input, PluginFormcreatorFormanswer $f
253253
$field_name = $decodedValues['dropdown_fields_field'] ?? '';
254254
$blocks_field = $decodedValues['blocks_field'] ?? '';
255255

256+
//load container field
257+
$container = new PluginFieldsContainer();
258+
$container->getFromDB($blocks_field);
259+
$related_itemtype = json_decode($container->fields['itemtypes'], true);
260+
261+
if (!in_array(get_called_class()::getTargetItemtypeName(), $related_itemtype)) {
262+
continue;
263+
}
264+
256265
$field = new PluginFieldsField();
257266
$field->getFromDbByCrit(['name' => $field_name]);
258267

0 commit comments

Comments
 (0)