Does not filter by content type in Drupal 10

Created on 9 May 2023, about 1 year ago

Problem/Motivation

The module bases its functionality in hook_field_widget_form_alter. This hook was deprecated in Drupal 9.2 and does not exist anymore in Drupal 10:

https://www.drupal.org/node/3180429 β†’

So all nodes are selectable even when some content types are not allowed in the field settings

Steps to reproduce

- Add a link field to "article" with "Which content types should be allowed for internal links?" -> Include, "Content types" -> Article.
- Add this field to the form in "Manage form display.
- Create one "Page" and one "Article"
- Create a second "Article" and in the Link field try selecting any of the previous content. Both will be available.

Proposed resolution

As suggested in the Change Record linked above, use hook_field_widget_single_element_form_alter instead of hook_field_widget_form_alter.

Remaining tasks

Test the supplied patch / MR.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain budalokko Girona

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024