A user must select a label and machine name for all new fields during the first of attaching the field to an entity. By default, the machine name is generated automatically based on the input of the label. However, there exists a UX issue whereby typing the label and hitting save too quickly may result in an incomplete machine name being generated. The problem seems to amplified on environments with less resources, such as local envs or shared hosts. To reproduce, consider the following:
Add a new field of any type to any entity. Type any name for the field label (although the longer the name, the more potential for problems) and quickly click "Save and Continue". The expected machine name for a label like user integration id would be field_user_integration_id, but the issue described might result in the machine name actually being set to something like field_user_integrat or field_user_integration.
This issue is also present when updating the label prior to submitting the form. Let's say you had a typo in your label. You meant for it to be Featured Article, but you accidentally type Featrued Article. Fixing the label and submitting the form too quickly may result in a label of Featured Article and machine name of field_featrued_article.
It may also be an issue when copy/pasting a value into the label field either as a fresh value, as in case 1 above, or as a replacement to an existing value, as in case 2.
Is there some way to block/delay submission of the form while that machine name is being generated? I haven't dug into the code at all, but I'd assume there's an ajax callback associated with the machine name generation that might be able to act on the related entity form.
Setting status to Major as due to "Cause user input to be lost, but do not delete or corrupt existing data."
Comments
Comment #2
mrweiner commentedComment #4
pameeela commented@mrweiner thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging Drupal core issues with the priority 'Major'.
This is a duplicate of #2662330: Machine name generation is way too slow so I'm going to close this. I'll update that issue as well to assign credit for if/when that issue gets fixed.