Why does it always put field prefix on me?

If you create a new field on an entity in the Drupal backend, the field name usually get's always prefixed with "field_". If you are like me and trust in the powers from above, you may have taken this for granted for a long time ...

Until someday I installed Commerce Kickstart distribution and wondered why the field names do not get prefixed there. First I did not directly see the coincedence on Commerce Kickstart, but just thought it might have been a wonder from above. Now I started the same project again without Commerce Kickstart and wondered why the 'field_' prefix was there again. This was finally the time I got curious about that and noticed that the field_ui module from Drupal Core comes with a setting for this: https://git.drupalcode.org/project/drupal/-/blob/81df3e9c1792b9ca08693f6...

Now Commerce Kickstart is changing this to not prefix: https://git.drupalcode.org/project/commerce_kickstart/-/blob/43780ce8ae8...

And so can you do on your own project:

Use a field_ui.settings.yml with just

field_prefix: ''
Tags: 

Neuen Kommentar schreiben

Filtered HTML

  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • HTML - Zeilenumbrüche und Absätze werden automatisch erzeugt.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.

Plain text

  • Keine HTML-Tags erlaubt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • HTML - Zeilenumbrüche und Absätze werden automatisch erzeugt.