Problem/Motivation

Extra fields are fake fields used to inject content into the form or display of an entity. It is a Core feature used by many modules and custom implementations.
Currently, extra fields are not available in pattern sources so they cannot be added to pattern fields and rendered within a pattern.

Proposed resolution

Add a Source plugin to make extra fields available.

Remaining tasks

  1. Copy PR from github to drupal.org
  2. Add automated tests

Github references

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:

Comments

DuaelFr created an issue. See original summary.

duaelfr’s picture

Assigned: duaelfr » Unassigned
Issue summary: View changes
Status: Active » Needs work

Code has been pushed to drupal.org fork.
Tests are still to be written.

g4mbini’s picture

duaelfr’s picture

Issue summary: View changes
Status: Needs work » Needs review

There we go!

grimreaper’s picture

To manually test what can be done?

On user entity, the history extra field for example can be injected inside a pattern now?

Something like that?

duaelfr’s picture

You can do that yes.
If you use Field Layout or Field Group (with the appropriate UI Patterns submodule), you'll be able to see if you can put the extra field in your pattern and if it's rendered as expected.

grimreaper’s picture

Ok for me.

I have tested with the "member for" field on the user profile and Field Layout, the MR was not needed in this case.

But then I tried with Field group on the basic page content type (see screenshot), and now without the patch the "links" extra field was not detected whereas whit the patch yes.

Merging.

grimreaper’s picture

  • Grimreaper committed df91310 on 8.x-1.x authored by DuaelFr
    Issue #3311088 by DuaelFr, Grimreaper, yannickoo: Add extra field...

  • Grimreaper committed 685ec74 on 8.x-1.x
    Issue #3311088 by DuaelFr, Grimreaper, yannickoo: Add extra field...
grimreaper’s picture

Status: Needs review » Fixed

Merged.

And I have added an empty commit for credit to @DuaelFr automated tests.

Thanks everyone!

  • Grimreaper committed 2e0ac04 on 8.x-1.x
    Issue #3311088 by DuaelFr, Grimreaper, yannickoo: Add extra field...
grimreaper’s picture

Squash during merge had removed @yannickoo commit authoring...

So another empty commit for him...

Status: Fixed » Closed (fixed)

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