Problem/Motivation

I needed a way to create an entity URI from a content reference for a link field.

Proposed resolution

I created a ReferenceUri yaml_content process plugin that extends the Reference plugin.

Remaining tasks

  • Code review.
  • Tests.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

The following code can be used to import a reference link:

field_link:
    - '#process':
        callback: 'reference_uri'
        args:
          - 'media'
          - bundle: 'document'
            name: "Media Document Example"
      title: "Media Document Example"

Comments

weekbeforenext created an issue. See original summary.

weekbeforenext’s picture

Issue summary: View changes
StatusFileSize
new1.32 KB

Attached a patch that adds a ReferenceUri process plugin.

weekbeforenext’s picture

Status: Active » Needs review
damienmckenna’s picture

Version: 8.x-1.0-alpha5 » 8.x-1.x-dev
Status: Needs review » Fixed
Parent issue: » #3055576: Plan for YAML Content 8.x-1.x-alpha6

Nice work, weekbeforenext!

Could you please add the documentation example to the snippets docs page? Thank you!

Let's do the tests separately (#3127221: Add test coverage for ReferenceUri plugin).

Committed.

weekbeforenext’s picture

damienmckenna’s picture

Thank you so much!

Status: Fixed » Closed (fixed)

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