- Issue created by @Giuse69
- Status changed to Closed: works as designed
8 months ago 4:36pm 31 October 2023 - 🇺🇸United States apmsooner
The field settings with cardinality set to limit functions as other Drupal core fields with similar cardinality settings. If for example you set limit to 3 and you are asking to not show 3 blank sets of values, I don't think the fix for that is appropriate here but rather in Core for ALL field types. I think this contrib module may help with that: https://www.drupal.org/project/sam → and there is an issue that addresses it in Core here: https://www.drupal.org/project/drupal/issues/1156338 ✨ Fixed maximum number of field values, but use «add more» similar to when cardinality «unlimited» is used Needs work . I'm going to mark this as closed in favor of the solutions there and hopefully will accommodate your request. Feel free to reopen if there is incompatible with one of those solutions specific to this field but I would assume if it works for other field types, it should work for this one. Thank you for using the module and requesting this feature, I do see the merit for it.
- 🇺🇸United States apmsooner
That sam module isn't compatible out of the box but seems it can be by providing a hook to alter fields allowed: https://www.drupal.org/project/sam/issues/3318973 → . You might try this to get it to work. I don't think I would support in the module by default otherwise since the more permanent goal in CORE support would eventually resolve. Best of luck.
- 🇺🇸United States apmsooner
If you want to use the sam module, Using this hook in your own module should work. These are the widgets custom_field provides.
function MY_MODULE_sam_allowed_widget_types_alter(array &$widget_types) { $widget_types[] = 'custom_stacked'; $widget_types[] = 'custom_flex'; }