Skip to:

Opened 12 months ago

Last modified 11 months ago

#3486 assigned defect (bug)

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 12 months ago.
3486_2.patch (676 bytes) - added by naxoc 12 months ago.

Download all attachments as: .zip

Change History (5)

12 months ago

#1 @johnjamesjacoby
12 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? 🛸

12 months ago

#2 @naxoc
12 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
11 months ago

  • Cc naxoc added
Note: See TracTickets for help on using tickets.