Problem/Motivation

The Edit and Delete action links for field dependencies are incorrectly pointing to a different entity type than the one being viewed. This prevents users from editing or deleting the correct conditional field configurations.

Example: While on /admin/structure/types/manage/guide/conditionals (viewing the "guide" content type), the Edit/Delete links incorrectly point to:

Edit - /admin/structure/conditional_fields/node/experience/field_range_prices/cf1d14f7-e868-49b7-ae3b-c4b8b33ca652/tab/edit and

Delete - /admin/structure/conditional_fields/node/experience/field_range_prices/cf1d14f7-e868-49b7-ae3b-c4b8b33ca652/tab/delete

The links reference the "experience" entity type instead of "guide".

Actual result: The Edit and Delete action links for field dependencies point to a different entity type

Proposed resolution

Fix the link generation logic to use the current entity type context instead of a hardcoded or incorrectly cached value
Review how entity type parameters are passed to the edit/delete route generation
Add tests to verify links are generated correctly for different entity types

Remaining tasks

Identify where the link generation occurs
Fix the entity type parameter handling
Write tests
Review and test

User interface changes

Edit/Delete links will correctly point to the entity type being viewed.

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

alen simonyan created an issue. See original summary.

velmir_taky made their first commit to this issue’s fork.

velmir_taky’s picture

Status: Active » Needs review
StatusFileSize
new4.75 KB

Fixed in the MR. The Edit/Delete links in ConditionalFieldForm::buildTable() used stored $condition['entity_type'] and $condition['bundle'] instead of $this->entityType and $this->bundleName from the form context.

Added a kernel test.

velmir_taky’s picture

Assigned: alen simonyan » Unassigned
benstallings’s picture

Status: Needs review » Reviewed & tested by the community

Assessment

- Fix is correct and minimal — only changes what's necessary
- Test is well-designed — directly tests the failure mode by injecting bad stored data
- No regressions expected — $this->entityType and $this->bundleName are set earlier in the form's build method from the route parameters, so they're always accurate for the current page context
- Clean diff — no unrelated changes

This looks good to merge.

joelpittet made their first commit to this issue’s fork.

joelpittet’s picture

Version: 4.0.0-alpha6 » 4.x-dev

Moving this to the 4.x-dev branch, where the fix needs to be made.

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all. The screenshot was extra helpful btw.

I merged the changes into the dev branch.

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.