Hi there,

We have enabled the Bootstrap theme for administering content & we've come across an error for unlimited fields. No errors are reported to the console but when using an unlimited long text field (textarea) the data entered into the field is wiped when adding a new instance.

Steps to recreate:

1: Create a new content type.
2: Add a new field - Text (formatted, long)
3: In field settings, set the field to unlimited.
4: Create a new piece of content of your new content type, add data into the first field then click Add another item & review what happens.

You will see previous entered data is no longer available & the textarea is empty.

Any help on what could be causing this will be appreciated.

Thank you,

Comments

i_g_wright created an issue. See original summary.

i_g_wright’s picture

Hi,

We have been looking into this a bit more & have found the issue but we are unsure of the benefits/disadvantages.

In themes/bootstrap/src/Plugin/Alter/ElementInfo.php if you comment out the if statement - lines 38 - 38 unlimited fields then work successfully.

if (isset($element['#base_type']) && isset($types[$element['#base_type']]) && isset($types[$element['#base_type']]['#input'])) {
  $element['#input'] = $types[$element['#base_type']]['#input'];
}

If someone can explain why the theme is adding the following to the $element array & what is the purpose of it, it will help us debug more & find a better solution than just comment out the lines.

$element['#input'] = TRUE;

Thank you,

markhalliwell’s picture

Status: Active » Closed (duplicate)
Related issues: +#2652782: Setting #input based on #base_type is unnecessary

This has long since been removed. Closing.