- First commit to issue fork.
- Status changed to Needs work
over 1 year ago 3:33pm 7 June 2023 - πΊπΈUnited States markie Albuquerque, NM
on reviewing, I am not sure what needs to be done to validate the code changes. Can we get some steps to reproduce or test instructions please.
- Status changed to Needs review
over 1 year ago 3:50pm 7 June 2023 - πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
As a developer of a site, I need to be able to add an entity reference field to a tags taxonomy from an article content type.
Validations steps/Acceptance criteria
- Create a "Tags" taxonomy
- Create a recipe that creates/installs an Article Content type and uses the setComponent config action to add a field_tags reference field from the content type's entity_view_display and entity_view_form configs to the taxonomy term
- Apply the recipe and validate that it installs successfully and creates the field, and adds it to the content type's display and form
- πΊπΈUnited States joegraduate Arizona, USA
Several of us a DrupalCon Pittsburgh are looking into this one (and trying to figure out how to review it).
- πΊπΈUnited States joegraduate Arizona, USA
I was able to verify that this config action works by doing the following:
- Cloned the issue branch/fork locally
- Adapted some of the work-in-progress recipes from this issue (modified versions attached to this comment)
- Installed Drupal minimal install profile
- Ran
php core/scripts/drupal recipe <recipe-name>
for thearticle_content_type
andtags_taxonomy
recipes - Ran
php core/scripts/drupal recipe <recipe-name>
for thearticle_tags
recipe - Verified that field_tags had been added to the displays for the article content type
I also pushed the important changes related to this action that I had to make to the WIP reciped copied from the #3301370: Model core's standard install profile as recipes β issue branch up to that branch. The diffs can be seen here:
https://git.drupalcode.org/issue/distributions_recipes-3301370/-/commit/...
https://git.drupalcode.org/issue/distributions_recipes-3301370/-/commit/...For testing this MR, I also removed the image field from the article recipe (see the zip file) to simplify things.
- Status changed to RTBC
over 1 year ago 7:15pm 8 June 2023 - πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Thanks Joe! Will try to get this reviewed and merged this week.
-
thejimbirch β
committed 699a7506 on 10.0.x authored by
alexpott β
Resolve #3304324 "Add config action"
-
thejimbirch β
committed 699a7506 on 10.0.x authored by
alexpott β
- Status changed to Fixed
over 1 year ago 5:12pm 20 June 2023 - πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Config Action
setComponent
added! Thanks all! Automatically closed - issue fixed for 2 weeks with no activity.
- π¨π¦Canada laura.j.johnson@gmail.com Toronto
I'm trying to use this to add a field to existing form and view displays using the sample action here, but I get this error:
In YamlSymfony.php line 40: Mapping values are not allowed in multi-line blocks
- Status changed to Fixed
9 months ago 8:48pm 22 February 2024 - π¨π¦Canada laura.j.johnson@gmail.com Toronto
My bad! Pro tip: use spaces rather than tabs in yaml.
- π¨π¦Canada laura.j.johnson@gmail.com Toronto
Also, the machine name of the field has to be in quotations.
core.entity_view_display.node.page.default: setComponent: 'field_content' - type: entity_reference_label label: above settings: link: true third_party_settings: { } weight: 10 region: content
- π¨π¦Canada laura.j.johnson@gmail.com Toronto
This adds the field, but it strips out all of the settings and third party settings. I'm wondering if there's another function I can use to add those...
https://git.drupalcode.org/project/distributions_recipes/-/blob/11.x/cor...
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
I have an open issue to update the docs:
https://www.drupal.org/project/distributions_recipes/issues/3395840 β
But yours is a little different.
Does this work plural also?
- π¨π¦Canada laura.j.johnson@gmail.com Toronto
This works:
core.entity_view_display.node.page.default: setComponent: name: field_content options: type: entity_reference_revisions_entity_view label: hidden settings: view_mode: default link: '' third_party_settings: { } weight: 10 region: content
This works with setComponents(): from here
core.entity_form_display.user.user.default: setComponents: - name: field_last_password_reset options: type: datetime_default weight: 4 region: content settings: { } third_party_settings: { } - name: field_password_expiration options: type: boolean_checkbox weight: 3 region: content settings: display_label: true third_party_settings: { }
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Updating issue summary with the final code.