Unable to add multiple fields at once without save

Created on 22 April 2024, 8 months ago
Updated 5 June 2024, 7 months ago

Problem/Motivation

When I try with Drupal 10.2.5 and 3.0.x-dev to add more fields in one custom field it remove them (intermittent) if it is not saved first.

1. Create a custom field
2. Try to add 5 + fields ( i have tried all with text field 255)
3. It is intermittent but when I wanted to add 4th field and click on "add another" it removed all previously created fields if not saved.
- sometimes it allows me to add 5 and when I tried to add sixth the same issue - all removed.

Currently to prevent that unwanted behavior I have to save the field after every second / third field. Once saved it wont' be removed but again if there are 3 (already saved) and i will add another 2 or 3 fields, it refresh the page and I can still see just saved 3 so again I need to create them because they were removed with no reason.

Looks like I need to save it all the time to prevent this.

I haven't experienced that issue on Drupal 9 and version 2.0.2

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    I think this is likely related to the same issue in this bug: https://www.drupal.org/project/custom_field/issues/3442408 πŸ› Max length storage/widget settings out of sync. Needs review so please apply that patch and report back if this issue is also resolved.

  • πŸ‡ΈπŸ‡°Slovakia coaston
  • Status changed to Needs work 8 months ago
  • πŸ‡ΈπŸ‡°Slovakia coaston

    @apmsooner

    -Unfortunately still the same issue, even I applied #10 patch from advised link. I have added like 6-7 so I thought the problem was resolved at first but tried to add 8th one and all got removed :(

  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Are there any errors in the logs or console errors related to ajax? This is odd...

  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Can you click the "set default value" widget to expose the default values form when you trigger the error to see if theres some sort of hidden validation going on there? I just added like 15 fields with no issues so something is a bit different with your settings perhaps.

  • Status changed to Postponed: needs info 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner
  • Status changed to Fixed 7 months ago
  • πŸ‡ΈπŸ‡°Slovakia coaston

    I think it was caused by me.

    Problem : I always needed to override the machine-readable name. But I wanted to be very fast so once I added some machine-readable name I immediately clicked on Add another button. However it seems I need to click outside of form first so Ajax will load it and then I can click "Add another".

    Here is picture where it is shown that I am still typing inside the form and in case I click Add another button it fails. So first I need to click outside and then continue.

  • Status changed to Closed: works as designed 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner
Production build 0.71.5 2024