Problem/Motivation

When text area with a summary has help text (description), button "Edit summary" is broken. Description html element has the same classes as text area element.

Proposed resolution

Specify jQuery selector only for textarea element.

Remaining tasks

The patch is ready for review

Files: 
CommentFileSizeAuthor
#42 interdiff-40-42.txt897 bytesJo Fitzgerald
#42 drupal-edit-summary-button-broken-2624496-42.patch4.99 KBJo Fitzgerald
#40 interdiff-38-40.txt742 bytesJo Fitzgerald
#40 drupal-edit-summary-button-broken-2624496-40.patch4.94 KBJo Fitzgerald
#38 interdiff-36-38.txt1.29 KBJo Fitzgerald
#38 drupal-edit-summary-button-broken-2624496-38.patch4.97 KBJo Fitzgerald
#36 interdiff-34-36.txt2.68 KBJo Fitzgerald
#36 drupal-edit-summary-button-broken-2624496-36.patch5.07 KBJo Fitzgerald
#34 interdiff-32-34.txt686 bytesmohit_aghera
#34 drupal-edit-summary-button-broken-2624496-34.patch5.21 KBmohit_aghera
#32 interdiff-29-32.txt716 bytesmohit_aghera
#32 drupal-edit-summary-button-broken-2624496-32.patch5.22 KBmohit_aghera
#31 After_Patch_#29.PNG48.33 KBTruptti
#31 _Before_Patch_#29.PNG38.18 KBTruptti
#29 interdiff-27-29.txt655 bytesmohit_aghera
#29 drupal-edit-summary-button-broken-2624496-29.patch5.05 KBmohit_aghera
#27 interdiff25_26.txt1.12 KBMunavijayalakshmi
#27 drupal_edit_summary_button_broken-2624496-26.patch5.05 KBMunavijayalakshmi
#25 drupal-edit-summary-button-broken-2624496-25.patch5.07 KBmohit_aghera
#20 interdiff-17-20.txt1.62 KBmohit_aghera
#20 drupal-edit-summary-button-broken-2624496-20.patch5.07 KBmohit_aghera
#17 interdiff-2624496-13-16.txt2.88 KBandrewmacpherson
#17 interdiff-2624496-4-16.txt1003 bytesandrewmacpherson
#17 drupal-edit-summary-button-broken-2624496-16.patch4.1 KBandrewmacpherson
#2 drupal-edit-summary-button-broken-2624496.patch600 byteszviryatko
#4 drupal-edit-summary-button-broken-2624496-4.patch2.95 KBdroplet
#5 Textarea-with-no-summary-field.png167.81 KBswetashahi
#8 after_patch.png124.17 KBuna_maria
#8 before_patch.png119.44 KBuna_maria
#9 after_patch.png66.36 KBkryp71c
#9 before_patch.png65 KBkryp71c
#13 drupal-edit-summary-button-broken-test-2624496-13.patch1.16 KBuna_maria

Comments

zviryatko created an issue. See original summary.

zviryatko’s picture

swentel’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +JavaScript, +Needs manual testing

Confirmed, marking RTBC for now, maybe more eyes will see this.

droplet’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.95 KB

Attached a patch to fix the multiple textarea with summary in same page.

Also created a new issue to remove the class in textarea: #2649544: Remove '.text-full' in description of textarea with a summary

swetashahi’s picture

Issue summary: View changes
FileSize
167.81 KB

Steps followed to test
1. Launched a simplytest instance with latest patch
2. Created a custom content type with 2 text area and summary enabled
3. On trying to add a new content for the custom content type, for text areas no summary field shows up
4. Unable to test
Text area has no summary field

swetashahi’s picture

Status: Needs review » Needs work

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

una_maria’s picture

Version: 8.1.x-dev » 8.2.x-dev
Status: Needs work » Needs review
FileSize
124.17 KB
119.44 KB

I've tested it and verified it's working. Steps followed to test:

  1. Pull latest Drupal version (8.2.x) to my local instance.
  2. Reproduce issue: add help text to Basic page's body, verify that Edit summary link doesn't display anymore.
  3. Apply patch #2 (drupal-edit-summary-button-broken-2624496.patch).
  4. Rebuild caches.
  5. Verify that Edit summary link displays and works as expected.

Before patch
After patch

Changed status to Needs review for someone else to double check it's working.

kryp71c’s picture

FileSize
66.36 KB
65 KB
kryp71c’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Followed una_maria's steps to verify this:

  1. Use latest drupal 8 version (8.2.x)
  2. Reproduced issue: edit body content type to add some help text -> add content basic page "Edit Summary" link is missing
  3. Applied patch from comment #2
  4. Rebuild cache
  5. "Edit Summary" link is now visible on add content basic page with help text
  6. Also tested this with two textarea fields. Still works.

This appears to be working correctly.
Changing the status to reviewed and tested.
Seeing as there is no way to edit the summary without the link the priority should be major. So, upgrading the priority.

Screenshot before applying the patch
Screenshot after applying the patch

kryp71c’s picture

Status: Reviewed & tested by the community » Needs review

Somehow my previous comment vanished.
Tested the patch from Comment #2 based on una_maria's steps and it works also for multiple textarea fields.

It seems to me the patch from comment #2 is sufficient to fix the original issue.

Changing the status back to "Needs Review", until we can test the patch form comment #4
The priority was changed to major since there is no way to edit the summary without the "Edit Summary" links.

joelpittet’s picture

Thank you @una_maria and @kryp71c for pushing this issue forward at yesterdays sprint.

@una_maria could you post your stub test patch that you were working on yesterday? I'll gladly try to push this forward from that point. Or you can feel free to flush the test out further.

I found a blog post that shows how to get the JavaScript Functional tests up an running locally.
https://www.chapterthree.com/blog/javascript-testing-comes-to-drupal-8

@droplet the code in #4 seems like a bit more than needed to fix the issue. Could you add steps to reproduce so we can ensure we cover all the fixes/improvements you made from #2? With that detail we can incorporate that into the JS regression tests.

una_maria’s picture

Hi @joelpittet, here's the stub test. I am not sure what are the conventions for tests (naming, etc.), hopefully this is still useful.

Thank you very much for your help, I'll be very interested on checking your further work on this.

Status: Needs review » Needs work

The last submitted patch, 13: drupal-edit-summary-button-broken-test-2624496-13.patch, failed testing.

andrewmacpherson’s picture

This patch combines those from comments #4 and #13, so we have the @droplet's fix and @una_maria's stub test in one patch.

The last submitted patch, 15: drupal-edit-summary-button-broken-14.patch, failed testing.

andrewmacpherson’s picture

Whoops, ignore the files in comment #15. I uploaded an empty file.

This patch combines #4 (@droplet's fix) and #13 (@una_maria's stub test) in one patch

andrewmacpherson’s picture

Status: Needs review » Needs work

The last submitted patch, 17: drupal-edit-summary-button-broken-2624496-16.patch, failed testing.

mohit_aghera’s picture

Adding basic test case related functions.

Status: Needs review » Needs work

The last submitted patch, 20: drupal-edit-summary-button-broken-2624496-20.patch, failed testing.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

OwilliwO’s picture

I have a look on this issue.
Provided patch fix problem, even in 8.3.x branch.
The problem is about provided tests.
Currently trying to understand what's wrong with it!

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mohit_aghera’s picture

Status: Needs work » Needs review
FileSize
5.07 KB

Updating patch from #20 for 8.4.x

Status: Needs review » Needs work

The last submitted patch, 25: drupal-edit-summary-button-broken-2624496-25.patch, failed testing.

Munavijayalakshmi’s picture

+++ b/core/modules/text/tests/src/FunctionalJavascript/TextIntegrationTest.php
@@ -0,0 +1,59 @@
+    $node = array(
+      'title' => $title,
+      'body' => array(array('value' => $this->randomMachineName(32))),
+      'uid' => $this->webUser->id(),
+      'type' => 'article',
+    );
...
+    $edit = array();

use short array syntax (new coding standard).

Fixed the short array syntax error and attached new patch.
.

Status: Needs review » Needs work

The last submitted patch, 27: drupal_edit_summary_button_broken-2624496-26.patch, failed testing.

mohit_aghera’s picture

Fixing permission for access content.

Status: Needs review » Needs work

The last submitted patch, 29: drupal-edit-summary-button-broken-2624496-29.patch, failed testing.

Truptti’s picture

FileSize
38.18 KB
48.33 KB

Verified the fix on Drupal 8.4.x-dev
1.Use latest drupal 8 version (8.4.x)
2.Add help text in Body field and reproduce the issue
3.Applied the patch 'drupal-edit-summary-button-broken-2624496-29.patch' in #29
4.The Edit Summary link is displayed on Body field with the Help text.
Attaching snapshot Before_patch_#29.png and After_patch_#29.png for reference

mohit_aghera’s picture

Attempt to fix testcase failures.

Status: Needs review » Needs work

The last submitted patch, 32: drupal-edit-summary-button-broken-2624496-32.patch, failed testing.

mohit_aghera’s picture

Updating patch.

Status: Needs review » Needs work

The last submitted patch, 34: drupal-edit-summary-button-broken-2624496-34.patch, failed testing.

Jo Fitzgerald’s picture

  1. Added $webUser.
  2. Tried to avoid permissions error by first creating the page content type.
  3. Use $this->createNode() rather than Node::create().
  4. Inline some redundant variables.
  5. Replace deprecated assertion method.

Status: Needs review » Needs work

The last submitted patch, 36: drupal-edit-summary-button-broken-2624496-36.patch, failed testing.

Jo Fitzgerald’s picture

  1. Replaced $this->webUser with simply $user.
  2. Replaced $this->createNode() with $this->drupalGet().

It may be worth investigating whether or not it is necessary to create and login as $admin_user (but my local test environment is not working so I'm taking this a step at a time).

Status: Needs review » Needs work

The last submitted patch, 38: drupal-edit-summary-button-broken-2624496-38.patch, failed testing.

Jo Fitzgerald’s picture

Removed "click edit link" - there is no edit link to click!

Status: Needs review » Needs work

The last submitted patch, 40: drupal-edit-summary-button-broken-2624496-40.patch, failed testing.

Jo Fitzgerald’s picture

Let's try creating a node and then editing it.

Status: Needs review » Needs work

The last submitted patch, 42: drupal-edit-summary-button-broken-2624496-42.patch, failed testing.

idebr’s picture