The field configuration form used to have the id "field_ui_field_instance_edit_form", and at some point (I believe as part of #2448503: Convert the "Field edit" form to an actual entity form) the id is now "field_config_edit_form" and the form structure is a bit different.

This patch makes the form alter work again. There is still an issue that keeps the token browser from showing up, but at least adding tokens works.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

floretan’s picture

FileSize
25.14 KB

$field->isLocked() doesn't exist anymore, and I'm not sure it's needed in this place anymore.

floretan’s picture

FileSize
2.37 KB

Oops, wrong patch

couturier’s picture

floretan, do you have update on the status of this issue? The official D8 release is here, and the Token module is moving fast toward an official 8.x release as well.

Berdir’s picture

Issue tags: +Needs tests

Will check this when the tests are passing again, automated tests would be great.

askibinski’s picture

Patch at #5 does return the "browse available tokens" in my admin screen, and it works although the dialog pops up in the bottom right corner and seems to have minor styling issues.

Curiously though, if I browse the tokens at the default core user picture field at:
admin/config/people/accounts/fields/user.user.user_picture
I'm not able to find the tokens which are used default as value for the map value:
pictures/[date:custom:Y]-[date:custom:m]

But that's probably a different issue.

hussainweb’s picture

I am bringing over the patch from #2639132: Token Browser does not appear on Field edit form which is very identical to the patch in #2 except for two things.

  • The isLocked() call is still important and this patch addresses it. If you do not check for that, there will just be a message saying the field is locked and the 'Browse available tokens' link.
  • The 'Browse available tokens' link should appear immediately after the help text field. This patch does that correctly.

Thanks for this. I didn't find this issue when I searched earlier or else I would have worked off this patch.

hussainweb’s picture

Status: Needs work » Needs review
hussainweb’s picture

Here is a test only and with tests patch. The test worked with fix on my local. I didn't try it without fix. Let's see what happens.

The last submitted patch, 8: field_configuration-2511324-8-tests-only-fail.patch, failed testing.

Berdir’s picture

Status: Needs review » Fixed

Awesome, thanks for writing a test!

  • Berdir committed 8a719fd on 8.x-1.x authored by hussainweb
    Issue #2511324 by floretan, hussainweb: Field configuration form_alter...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.