Problem

I want to be able to allow users to select a pre-existing paragraph by using a "Select" entity reference field. However pargraphs are not showing up as entity type.

Reason, is this code:

    // Entity Reference fields are no longer supported to reference Paragraphs.
    // @see paragraphs_form_field_storage_config_edit_form_alter()
    $target_type_options = $this->entityTypeRepository->getEntityTypeLabels(TRUE);
    unset($target_type_options[(string) $this->t('Content')]['paragraph']);

However, this was changed a while ago #3414495: Change paragraphs_form_field_storage_config_edit_form_alter() to only discourage paragraph target references, not disallow. so there seems to be no reason for webform to disallow it.

Issue fork webform-3559041

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

fago created an issue. See original summary.

fago’s picture

Status: Active » Needs review

Let's fix this then.

liam morland made their first commit to this issue’s fork.

petar_basic’s picture

Assigned: Unassigned » petar_basic
petar_basic’s picture

Status: Needs review » Reviewed & tested by the community

Tested MR !778.

Before: Paragraphs not available as entity reference target type.
After: Paragraphs appear in target type options and can be selected/referenced as expected.

Works as intended, code changes look good, marking RTBC.

liam morland’s picture

In what issue/commit was this code added? Before removing that code, we need to understand when it was added and why. Then we can decide whether that reason still applies.

liam morland’s picture

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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