Problem/Motivation

When editing a channel (for example admin/config/services/entity_share/channel/abc/edit). and then adding a new search, the label of the added search replaces the label of the channel.

Steps to reproduce

Browse to add a channel: admin/config/services/entity_share/channel/add
Enter label "New Channel label"
Select Entity type "Content"
Select Bundle "Basic Page"
scroll to the bottom and click "Save"

Edit the newly created channel: admin/config/services/entity_share/channel/new_channel_label/edit
Observe the channel label is "New Channel label"
Click on the "Add a new search" button
Enter "status" for Path
Enter "New sort" for Label
Click "Save"

You will now be back at the Channel edit screen. Observe that the Channel title has now become the title of the new search you just added.

Proposed resolution

This is caused by both fields having the same form element id "edit-label".
in SearchAddForm.php change line 38 from

$form['label' = [

to

$form['search_label'] = [

fixes this issue. I guess the same would apply in SearchEditForm.php

Remaining tasks

Apply patch to code

User interface changes

nil

API changes

nil

Data model changes

nil

CommentFileSizeAuthor
#3 3174812-2.patch1.13 KBBagz
#3 3174812-1.patch1.07 KBBagz
#2 3174812-2.patch762 bytesBagz
#2 3174812-1.patch701 bytesBagz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bagz created an issue. See original summary.

Bagz’s picture

FileSize
701 bytes
762 bytes

Ignore these patches, they are not complete.

Bagz’s picture

FileSize
1.07 KB
1.13 KB

New patch files that also fix the Save method.

Grimreaper’s picture

Status: Active » Needs review
Grimreaper’s picture

Version: 8.x-3.0-alpha1 » 8.x-3.x-dev
Status: Needs review » Reviewed & tested by the community

Hello,

Thanks a lot for the issue and the patch.

Also nice to see detailed steps to reproduce the issue.

I confirm the bug, nice catch!

At the beginning I didn't understand why patch impacted SearchAddForm and SearchEditForm and not the ChannelForm directly. Because all herits from EntityForm so 'label' is a special machine name.

Even if the patches do not apply because of the path and also one patch per modified file is not ideal. It is ok :). It is simple to apply manually.

Going to merge.

  • Bagz authored 659cc01 on 8.x-3.x
    Issue #3174812 by Bagz, Grimreaper: When adding a Search the Channel...
Grimreaper’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Thanks!

Status: Fixed » Closed (fixed)

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