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.

CommentFileSizeAuthor
#3 myfix-3436243-1.zip963 bytesdimpalmangrulkar20@gmail.com

Issue fork drupal-3511434

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

alberto56 created an issue. See original summary.

cilefen’s picture

Component: base system » typed data system
Issue tags: +Documentation
dimpalmangrulkar20@gmail.com’s picture

StatusFileSize
new963 bytes

### 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. 🚀

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

juandhr changed the visibility of the branch 11.x to hidden.

juandhr changed the visibility of the branch 11.x to active.

juandhr changed the visibility of the branch 11.x to hidden.

juandhr’s picture

Status: Active » Needs review

Hi @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.

quietone’s picture

Version: 11.1.x-dev » 11.x-dev
Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Thanks 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.

sivaji_ganesh_jojodae’s picture

Issue summary: View changes
sivaji_ganesh_jojodae’s picture

Status: Needs work » Needs review
Issue tags: -Documentation, -Needs issue summary update
sivaji_ganesh_jojodae’s picture

Priority: Normal » Minor
Status: Needs review » Reviewed & tested by the community
Issue tags: +Documentation

The MR looks fine to me.

quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

This 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.

sivaji_ganesh_jojodae’s picture

I don't find reference to original interface name change. However I can see usage change in issue #2002134 commit id f6161fad

quadrexdev’s picture

Status: Needs work » Needs review

Yep, it was changed within #2002134

We may see the change here -> https://git.drupalcode.org/project/drupal/-/commit/f6161fadb069ac3cb260c...

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Believe question #14 is answered

ghost of drupal past’s picture

Yes: it was added in 2013 in #2047229: Make use of classes for entity field and data definitions and got renamed to ListDataDefinitionInterface in 2014 in #2002134: Move TypedData metadata introspection from data objects to definition objects still within the 8.x development cycle and these comments remained.

ghost of drupal past’s picture

Title: There are references in comments to nonexistent \Drupal\Core\TypedData\ListDefinitionInterface » There are leftover references in comments to long ago renamed ListDefinitionInterface

  • longwave committed c5aac176 on 10.4.x
    Issue #3511434 by juandhr, dimpalmangrulkar20@gmail.com,...

  • longwave committed 297b9806 on 10.5.x
    Issue #3511434 by juandhr, dimpalmangrulkar20@gmail.com,...

  • longwave committed 8c7ffa56 on 11.1.x
    Issue #3511434 by juandhr, dimpalmangrulkar20@gmail.com,...

  • longwave committed 1935c084 on 11.x
    Issue #3511434 by juandhr, dimpalmangrulkar20@gmail.com,...
longwave’s picture

Version: 11.x-dev » 10.4.x-dev
Status: Reviewed & tested by the community » Fixed

Backported 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!

Status: Fixed » Closed (fixed)

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