When I try to submit a comment on a node, hide_submit module doesn't work. It is not hiding the submit button. But when I try to submit an empty comment, since comment field is required, it gives me an error and if then I enter a comment and try to submit , it works. I tried debugging the issue, and this is happening because comment form is lazyloaded through bigpipe module and the response of AJAX request is FORM itself. So, in Drupal behavior it is not able to find form in context.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nikitaaswani created an issue. See original summary.

nikitaaswani’s picture

Issue summary: View changes
nikitaaswani’s picture

Issue summary: View changes
nikitaaswani’s picture

Status: Active » Needs review
FileSize
7.87 KB

Since sometimes the response of AJAX is form itself, instead of finding form in context, checked if context has tag form or document. Attaching patch to resolve the issue.

nikitaaswani’s picture

Assigned: nikitaaswani » Unassigned
ambuj_gupta’s picture

Assigned: Unassigned » ambuj_gupta
ambuj_gupta’s picture

Tested and verified the module after adding the patch created by @nikitaaswani. And it is working as expected.

ambuj_gupta’s picture

Assigned: ambuj_gupta » Unassigned
Status: Needs review » Reviewed & tested by the community
nikitaaswani’s picture

Assigned: Unassigned » nikitaaswani
Status: Reviewed & tested by the community » Needs work

Will be fixing the linting issues in the patch.

nikitaaswani’s picture

Assigned: nikitaaswani » Unassigned
Status: Needs work » Needs review
FileSize
13.36 KB
12.6 KB

Fixed the linting issues in the last patch.

nehajyoti’s picture

@nikita,

  1. What is // eslint-disable-next-line object-shorthand in https://www.drupal.org/files/issues/2019-11-08/interdiff_10-13.txt file ?
  2. What is https://www.drupal.org/files/issues/2019-11-08/interdiff_10-13.txt file?

------------------------

Committing the patch - lazyload_issue-3085453-10.patch to 8.x branch. ( Note: Have release alpha3 release just before applying this patch).

  • nikitaaswani authored 81b1ffa on 8.x-1.x
    Issue #3085453 by nikitaaswani: Hide submit not working on comment form...
nehajyoti’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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