Skip to:

Opened 22 months ago

Closed 3 weeks ago

#3486 closed defect (bug) (fixed)

The content-archive-forum.php template does not filter if the search form should be displayed

Reported by: naxoc's profile naxoc Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.10 Priority: normal
Severity: normal Version: trunk
Component: Component - Search Keywords: has-patch changes-requested
Cc: naxoc


Other templates wrap outputting the search from in a conditional using bbp_allow_search(). The attached patch wraps the search form in a conditional.

I copied over the div wrapper with the bbp-search-form class that the search form is wrapped in from content-archive-topic.php too.

Attachments (2)

3486.patch (649 bytes) - added by naxoc 22 months ago.
3486_2.patch (676 bytes) - added by naxoc 22 months ago.

Download all attachments as: .zip

Change History (7)

22 months ago

#1 @johnjamesjacoby
22 months ago

  • Keywords has-patch changes-requested added
  • Milestone changed from Awaiting Review to 2.6.10
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned

Hey @naxoc 👋 thank you kindly for opening this ticket 🙏 and attaching a patch, too 🙌 Awesome! 🌻

You are 100% correct – this inconsistency is an unintentional oversight, and we will get it corrected together 🤝

It looks like it was in r6630 when some of this related code was changed last, by me – lucky! 🤣

If I am remembering previous-me's intentions from 5 years ago 👯‍♂️ I believe we may want to try a patch that is essentially the inverse:

  • rather than add it to content-archive-forum.php
  • remove it from content-archive-topic.php
  • look in form-search.php in any child themes for the bbp_allow_search() check and .bbp-search-form wrapper div, and add them there if they are missing

What do you think? 💭

Question: in the bbPress site you are working on, were you seeing a search form when you shouldn't, none when you should, multiple forms, or something even weirder? 🛸

22 months ago

#2 @naxoc
22 months ago

Thank you for the quick reply! The inverse sounds like a much better approach :)

I've added a new patch that removes the conditional from content-archive-topic.php instead. The class is output in form-search.php like you say, so that is much cleaner.

As to if I'm seeing weird 🛸 stuff with search, then no not really, so all is good. We are using Jetpack search instead, so I was just going through the templates checking for search overrides (we are in the process of upgrading from 2.5 -> 2.6).

#3 @naxoc
21 months ago

  • Cc naxoc added

#4 @arafatjamil01
9 months ago

The code is more consistent now. Removing bbp_allow_search() is a better idea.

I have tested the patch - 3486_2.path by applying it in SVN. Everything works fine. I think it is ready to be released.

#5 @johnjamesjacoby
3 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7259:

Templates: remove duplicate div from content-archive-topic.php.

This change removes an unnecessary bbp_allow_search() call – as well as an extra div.bbp-search-form – from the Topic Archive template part.

Fixes #3486.

Props naxoc, arafatjamil01.

In branches/2.6, for 2.6.10.

Note: See TracTickets for help on using tickets.