Add test coverage for file entity reference selection plugin

Created on 10 October 2014, about 11 years ago
Updated 27 January 2023, almost 3 years ago

Problem/Motivation

Creating a node with a entity reference field refer to a file got an error (on js console):
Fatal error: Call to a member function range() on a non-object in /core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php on line 184

Steps To Reproduce

Create a content type "File", with a file field "File"

Add some contents to "File"

Add reference field "File Reference" to "Article", then set "Type of item to reference" to "File" ("File" entity type, not "Content" entity type with bundle "File")

Open javascript console, then add new "Article"

Expected: autocomple work, with a list of file including sample.jpg
Actual: autocomple does not work, with an error:

📌 Task
Status

Needs work

Version

10.1

Component
File module 

Last updated 2 months ago

Created by

🇻🇳Vietnam tien.xuan.vo

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    Thinking I got tickets crossed in #28?

    But ran #27 for D10 tests and had CI failures.

  • First commit to issue fork.
  • Merge request !12264Refactor the existing functional test. → (Open) created by mohit_aghera
  • 🇮🇳India mohit_aghera Rajkot

    - Updated a new kernel test to validate the entity query results.
    - Using other general practices for creating fields etc.

    Code is already fixed so no changes are required in EntityReference handler plugin.
    Hiding existing patches in favour of MR.

    Tests are passing on local.

  • Pipeline finished with Failed
    6 months ago
    Total: 166s
    #509238
  • Pipeline finished with Failed
    6 months ago
    Total: 175s
    #509249
  • Pipeline finished with Failed
    6 months ago
    Total: 581s
    #509261
  • 🇺🇸United States smustgrave

    Thanks for working on this!

    Test failures seem related to this change.

  • Pipeline finished with Failed
    6 months ago
    Total: 496s
    #509985
  • 🇮🇳India mohit_aghera Rajkot

    MR is green now.
    Moving back to NR

  • Pipeline finished with Success
    5 months ago
    Total: 546s
    #519692
  • 🇺🇸United States smustgrave

    Thanks for fixing that, seems like good test coverage. LGTM.

  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    5 months ago
    Total: 535s
    #530712
  • 🇮🇳India mohit_aghera Rajkot

    Moving back to RTBC since the MR is already green.

  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇮🇳India mohit_aghera Rajkot

    Updated the branch with latest 11.x
    Though "needs-review-queue-bot" commented, however, I didn't noticed any merge conflicts though.

  • Pipeline finished with Success
    4 months ago
    #549082
  • Issue was unassigned.
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 146s
    #623133
  • Pipeline finished with Failed
    about 1 month ago
    Total: 810s
    #623138
  • Status changed to Fixed 19 days ago
Production build 0.71.5 2024