- Issue created by @hungdo
- 🇹🇭Thailand Nick Hope
I confirm this in 2.0.0-beta1 in D10.2.1 with PHP 8.3. I tested a media item form and with a taxonomy term form.
Only new buttons are affected. Existing custom add and remove buttons still display correctly.
Neither #2 nor #4 at https://www.drupal.org/project/custom_add_another/issues/3411400 🐛 TypeError: array_unshift(): Argument #1 ($array) must be of type array, null given in array_unshift() Needs review help fix this.
I don't believe the issue meets the requirements for critical status → , but obviously it's useless going forward.
-
Steven Jones →
committed 19961f40 on 2.x
Issue #3411964: Fix our version constraint to working versions of Drupal...
-
Steven Jones →
committed 19961f40 on 2.x
-
Steven Jones →
committed c5cb9601 on 2.x
Issue #3411964 by Steven Jones: The custom add more button labels aren't...
-
Steven Jones →
committed c5cb9601 on 2.x
- Status changed to Fixed
12 months ago 8:16pm 6 January 2024 - Status changed to Needs work
12 months ago 5:17am 8 January 2024 - 🇹🇭Thailand Nick Hope
Thanks for the new releases, but unfortunately I've still got the same problem with 2.1.0-beta1 in D10.2.1 with PHP 8.3.1. The labels are not saved.
- 🇬🇧United Kingdom steven jones
@Nick Hope are you sure you've rebuilt caches etc?
- 🇹🇭Thailand Nick Hope
I've done further testing. Sites are both D10.2.1 with PHP 8.3.0. These were the steps. Unexpected results are in bold...
On near-vanilla test site:
- composer require 'drupal/custom_add_another:^2.1@beta'
- drush en custom_add_another
- drush updb
- drush cr
- Add new plain text field to basic page content type.
- Set to unlimited.
- Set custom add button text "Add another thing".
- Set custom remove button "Remove thing".
- Save
- Edit
- Add button displays custom text "Add another thing".
- Remove button displays standard text "Remove".
- Edit the field in the basic page content type.
- Both custom button fields still contain the custom text.
On a complex development site (with very long history):
- Delete module
- "drupal/custom_add_another": "^2.1@beta",
- drush cr
- Clear all caches in browser too (Admin Toolbar).
- Add new plain text field to basic page content type.
- Set to unlimited.
- Set custom add button text "Add another thing".
- Set custom remove button "Remove thing".
- Save
- Edit
- Add button displays standard text "Add another item".
- Remove button displays standard text "Remove".
- Edit the field in the basic page content type.
- Both custom button fields are empty.
- Repeat steps, adding unlimited plain text field to audio file media type. Same result.
- Added custom remove text to a taxonomy term field that already had custom add text (from a long time ago). After saving, both the custom add text and custom remove text in that field config were empty.
I'll try and do more testing with older versions of PHP / Drupal / CAA to try and narrow down the problem. Maybe I'll also see if values stick if I manually edit the database.
- 🇮🇳India junaidpv Kannur, Kerala
I am facing same issue as the scenario 1 given in comment #11. Rebuilding the cache did not help.