Skip to content

Commit 060fadd

Browse files
authored
Remove group from link fields list, because now it's possible to add more than one group to an item. (#541)
* Remove group from link fields list, because now it's possible to add multiple groups to an item * Fix ajax * Fix lints * Update CHANGELOG
1 parent e987665 commit 060fadd

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [UNRELEASED]
99

10+
### Fixed
11+
12+
- Remove groups as import link field
13+
1014
## [2.15.1] - 2025-10-14
1115

1216
### Fixed

inc/injectiontype.class.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class PluginDatainjectionInjectionType
3737
{
3838
public const NO_VALUE = 'none';
3939

40+
public const NON_MANDATORY_FIELDS = [
41+
'groups_id', // Groups removed because they have become multiple fields for assets
42+
];
43+
4044

4145
/**
4246
* Return all injectable types
@@ -251,6 +255,7 @@ public static function dropdownFields($options = [])
251255
],
252256
);
253257

258+
$p['value'] = '__VALUE__';
254259
$url = plugin_datainjection_geturl() . "ajax/dropdownMandatory.php";
255260
Ajax::updateItem(
256261
"span_mandatory_" . $mapping_or_info['id'],
@@ -307,10 +312,9 @@ public static function testBasicEqual($name, $option = [])
307312
|| (strtolower($option['linkfield']) == $name);
308313
}
309314

310-
311315
/**
312316
* @param array $options array
313-
**/
317+
**/
314318
public static function showMandatoryCheckbox($options = [])
315319
{
316320

@@ -333,8 +337,10 @@ public static function showMandatoryCheckbox($options = [])
333337
}
334338

335339
if (
336-
($options['called_by'] == 'PluginDatainjectionInfo')
337-
|| ($options['primary_type'] == $options['itemtype'])
340+
$options['called_by'] == 'PluginDatainjectionInfo' || (
341+
$options['primary_type'] == $options['itemtype']
342+
&& !in_array($options['value'], self::NON_MANDATORY_FIELDS)
343+
)
338344
) {
339345
echo "<input type='checkbox' name='data[" . htmlspecialchars($mapping_or_info['id']) . "][is_mandatory]' $checked>";
340346
}

0 commit comments

Comments
 (0)