On testing the d8 port I recognized that there is currently the field name used as default field value.
I didn't know if we really need a default value on a field which is hardcoded to be unique. On the field settings form there is currently displayed an information about default value but no text field to fill. Maybe this is combined problem.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

C_Logemann created an issue. See original summary.

C-Logemann’s picture

Added a screenshot of field settings.

andypost’s picture

yep, that's strange behaviour I guess better to allow use tokens to generate default value

dksdev01’s picture

Assigned: Unassigned » dksdev01

taking over this issue to have a stable release for 8.x and 9.x

C-Logemann’s picture

@dksdev01 Any progress on this issue? If you need help just ask. And if you don't have time please unassign yourself.

dksdev01’s picture

Assigned: dksdev01 » Unassigned

Dmitriy.trt made their first commit to this issue’s fork.

Dmitriy.trt’s picture

Status: Active » Needs review
FileSize
515 bytes

Created MR!1 with a quick fix. Machine name form element attaches to label input by default and it's the field name in this case. The fix is to stop it from doing so. It also affects actual entity forms, but I would really say it was a bug that module didn't handle it there too. First idea was to make the source configurable, but it doesn't work well. See #990218: Machine name field throws notices if before source field. and the way it was fixed. Since we can't guarantee the order in which widgets appear in the form structure, it doesn't look possible to control the source from the widget level. But it should still be possible to re-add the machine name to the form structure from a hook_form_alter() implementation and guarantee the order of fields in the PHP array.

The fix also doesn't update existing fields, that's up to site maintainers, I believe.

Attaching the diff for a stable reference from composer. It was made from MR!1 at commit b98412fd.

_shY made their first commit to this issue’s fork.

_shY’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and tested the merge request !1, looks fine.
Also, updated the commit according to the last branch changes.

C-Logemann’s picture

Status: Reviewed & tested by the community » Needs review

@_shY Please don't mark your own code contributions by yourself as RTBC.

abramm’s picture

Hi @C-Logemann, thanks for pointing on this!

@_shY is doing some work under my mentoring; we'd like to try adding some tests before merging the patches for the issues we currently have.

I'll keep an eye on this.

svetoslav.dragoev’s picture

Re-roll of patch #9 against latest release: dev-1.x 0805042.

svetoslav.dragoev’s picture

svetoslav.dragoev’s picture

Unfortunately selected wrong file on first upload and updating it did not work, so uploading once again :) (use this one).

Status: Needs review » Needs work

The last submitted patch, 16: machine_name-empty_source-2832150-16.diff, failed testing. View results

svetoslav.dragoev’s picture

#16 contained wrong filename, correcting it. Patch is the same, just fixing it to not change the filename.