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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | conditional_fields-fix-edit-delete-links-entity-type-3574101-4.patch | 4.75 KB | velmir_taky |
| 2026-02-18_00-18.png | 124.84 KB | alen simonyan |
Issue fork conditional_fields-3574101
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
Comment #4
velmir_taky commentedFixed in the MR. The Edit/Delete links in
ConditionalFieldForm::buildTable()used stored$condition['entity_type']and$condition['bundle']instead of$this->entityTypeand$this->bundleNamefrom the form context.Added a kernel test.
Comment #5
velmir_taky commentedComment #6
benstallings commentedAssessment
- 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.
Comment #8
joelpittetMoving this to the 4.x-dev branch, where the fix needs to be made.
Comment #9
joelpittetThank you all. The screenshot was extra helpful btw.
I merged the changes into the dev branch.