Problem/Motivation
In code comments, there are three references to the interface \Drupal\Core\TypedData\ListDefinitionInterface, which does not seem to exist. If you encounter references to \Drupal\Core\TypedData\ListDefinitionInterface in code comments or documentation, they might be erroneous, as this interface does not exist in Drupal 11.
Steps to reproduce
$ grep -R 'ListDefinitionInterface' .
./core/lib/Drupal/Core/TypedData/ListInterface.php: * @see \Drupal\Core\TypedData\ListDefinitionInterface
./core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php: * @see \Drupal\Core\TypedData\ListDefinitionInterface
./core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php: * \Drupal\Core\TypedData\ListDefinitionInterface interface
$ ls -lah core/lib/Drupal/Core/TypedData/ListDefinitionInterface.php
ls: core/lib/Drupal/Core/TypedData/ListDefinitionInterface.php: No such file or directory
Proposed resolution
In Drupal 11, there is no interface named \Drupal\Core\TypedData\ListDefinitionInterface. If you're looking for the interface that defines data definitions for lists, you should use \Drupal\Core\TypedData\ListDataDefinitionInterface instead.
Remaining tasks
Check the commit history to verify that the name change is correct.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | myfix-3436243-1.zip | 963 bytes | dimpalmangrulkar20@gmail.com |
Issue fork drupal-3511434
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:
- 3511434-remove-references-to-listdefinitioninterface
changes, plain diff MR !11416
- 11.x
compare
Comments
Comment #2
cilefen commentedComment #3
dimpalmangrulkar20@gmail.com commented### Issue: Fix List Definition Issue
This patch resolves the issue where the list definition was incorrect.
### Steps to Reproduce the Issue:
1. Navigate to the affected page in the admin panel.
2. Observe that the incorrect list structure causes an error.
### Steps Taken to Fix the Issue:
- Adjusted the array structure to match Drupal's expected format.
- Ensured compatibility with other list-based components.
### How to Test the Patch:
1. Apply this patch using `git apply myfix-3436243-1.patch`.
2. Clear the cache using `drush cache:rebuild`.
3. Verify that the issue is resolved by checking the affected page.
### Next Steps:
Please review this patch and provide feedback. 🚀
Comment #9
juandhr commentedHi @alberto56,
I've updated the docblock in Drupal\Core\TypedData\ListInterface and Drupal\Core\TypedData\DataDefinitionInterface interfaces with the existing Drupal\Core\TypedData\ListDataDefinitionInterface interface, please check.
Comment #10
quietone commentedThanks for working on this!
The "proposed resolution" section should be complete and explain the actual change to help the reviewer and committer. Also, this should have some research to support that the change is correct. That is, what is the issue that replaces \Drupal\Core\TypedData\ListDefinitionInterface with something else. Using git blame should make it simple to identify when the changes was made.
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies.
Comment #11
sivaji_ganesh_jojodae commentedComment #12
sivaji_ganesh_jojodae commentedComment #13
sivaji_ganesh_jojodae commentedThe MR looks fine to me.
Comment #14
quietone commentedThis needs confirmation that the class name change is correct, as stated in #10.
What should happen is to find the commit where the old name was changed and read that commit. This command should help find the commit,
git log -S"\Drupal\Core\TypedData\ListDefinitionInterface".I have restored the 'remaining tasks' to add this point.
Comment #15
sivaji_ganesh_jojodae commentedI don't find reference to original interface name change. However I can see usage change in issue #2002134 commit id f6161fad
Comment #16
quadrexdevYep, it was changed within #2002134
We may see the change here -> https://git.drupalcode.org/project/drupal/-/commit/f6161fadb069ac3cb260c...
Comment #17
smustgrave commentedBelieve question #14 is answered
Comment #18
ghost of drupal pastYes: it was added in 2013 in #2047229: Make use of classes for entity field and data definitions and got renamed to
ListDataDefinitionInterfacein 2014 in #2002134: Move TypedData metadata introspection from data objects to definition objects still within the 8.x development cycle and these comments remained.Comment #19
ghost of drupal pastComment #25
longwaveBackported down to 10.4.x as a docs-only fix.
Committed and pushed 1935c084986 to 11.x and 8c7ffa560b6 to 11.1.x and 297b980640b to 10.5.x and c5aac1766a7 to 10.4.x. Thanks!