Split-off from #2723847: Repeat field_prefix and field_suffix rendered.

After used bootstrp theme, the search form broken on search page, just config "Use search" permission, no "Use advanced search". if user have "Use advanced search" permission, search form will have another submit button under "Advanced Search".

Why it happen, becuase bootstrap theme alter search form, and set "#input_group_button" to keywords field. So before form render out, it will find the nearest button, then render as keywords "#field_suffix" and set access property to "FALSE" for that button, that's reason why submit broken. the same issue will happen on other forms if used #input_group_button property.

My solution is: after render button as "#field_suffix" of other element, just set a new property "input_group_button_processed", and mapping to variables, then there's a new variable "input_group_button_processed" for template fiels input--button*.html.twig, jsut output button if not input_group_button_processed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markhalliwell’s picture

everright created an issue.

hswong3i’s picture

Status: Active » Needs review
FileSize
6.76 KB

Latest comment on #2723847-14: Repeat field_prefix and field_suffix rendered:

  1. This issue was (primarily) about the repeat field_prefix and field_suffix.
  2. We do not (generally) combine two separate issues, no matter how "related" they are. This is why we have a "Related issues" field.
  3. I can confirm the bug for anonymous users and have created the related follow-up issue.
  4. I do not believe the patches above are the correct approach, regardless if it "works". There is a lot of circumventing and duplication of information. This shouldn't be necessary. I will have to step through this (again) to see what the issue is. It's likely a one/two liner fix somewhere.

Migrate latest patch from #2723847-12: Repeat field_prefix and field_suffix rendered for review.

markhalliwell’s picture

Status: Needs review » Needs work

I really don't understand why I have to keep repeating myself. The above patch is NOT the correct approach. It will NOT be committed.

hswong3i’s picture

Status: Needs work » Needs review
FileSize
6.63 KB

@markcarver after 5 months and looking forward for your official solution, but not yet solved by else commit and no luck that problem still exists, so I need to revoke this patch for encouraging other contributors for giving a hand. At least, it is a dirty workaround.

markhalliwell’s picture

Status: Needs review » Needs work

I don't commit dirty workarounds. I don't know when I'll be able to look at this, it hasn't really been a priority.

Also, the above patch(es) are just the same patch in #2723847: Repeat field_prefix and field_suffix rendered, which includes hacks for removing the "double prefix" (which that issue already solved).

This isn't a proper "solution".

Please find a different approach if I can't get to this fast enough for you.

nikathone’s picture

Uploading a fix suggested by markcarver on slack

  • markcarver committed b8d0024 on 8.x-3.x authored by nikathone
    Issue #2765505 by nikathone, markcarver, everright: Search not working...
markhalliwell’s picture

Status: Needs work » Fixed

Thanks @nikathone!

hswong3i’s picture

wow @nikathone thank you very much~~~

Status: Fixed » Closed (fixed)

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