Edit content button does nothing when entity reference view is shown

Created on 14 March 2021, over 3 years ago
Updated 10 July 2024, 4 months ago

Problem/Motivation

If it helps, I'm using Drupal Core 8.9.13 with the Entity module version 8.x-1.2 .

Clicking the "Edit content" button does nothing regardless of what is selected in the entity reference view

Steps to reproduce

  1. Create two content types each with a simple text field in addition to the body fields
  2. Create a couple of instances of the first type
  3. Create a View of the first type with an "Entity Reference" display and just show the simple text field
  4. Edit the second entity type
  5. Create an entity reference field pointing to the first type
    • Reference method: Views: Filter by an entity reference view
    • In "View used to select the entities", select the view you created in step 3
    • Choose the "on" option for both the Add and Edit entityconnect buttons
    • Choose text only on both buttons
  6. Save the second content type with the new field
  7. Go to Add content and create an instance of the second type
  8. Select one of the instances of the first type that appear in the Entity Reference view
  9. Click Edit content and notice that nothing happens

Proposed resolution

I modified the "assets/js/entityconnect.js" file so that the
$(".entityconnect-edit input").once("entityconnect").click() function returns true
if at least one item is selected in the Entity Reference view

In that function I inserted the following code:

        var selected_value = $(".field--type-entity-reference select option:selected");
        return ((selected_value.length) ? true : false);

Remaining tasks

I also modified other parts of the module to fit my needs, but I hope the code above helps other people.

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rogman_lebnh

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

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • Status changed to Closed: cannot reproduce 4 months ago
  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    Tested all steps but was not able to reproduce. Probably, it was fixed by another issue. Please, use a new release of the module.

    thanks

Production build 0.71.5 2024