fix: compatibility with blomstra/search - #20
Merged
Conversation
Pass tags via filter[tag] instead of embedding tag: gambits in filter[q]. When there is no free-text search term, filter[q] is omitted entirely, which avoids blomstra/search's ApiClient override rerouting the request to its Elasticsearch endpoint (which does not parse tag: gambits). Closes #17
imorland
force-pushed
the
im/blomstra-search-compat
branch
from
April 20, 2026 17:35
5bc4459 to
0bb5278
Compare
3 tasks
imorland
added a commit
that referenced
this pull request
Apr 20, 2026
* test: add PHPUnit integration suite via flarum/testing
Covers all feed routes: /rss, /atom, /rss/discussions, /rss/d/{id},
/rss/u/{username}/posts, /rss/t/{slug}, /rss/t/{slug}/discussions
(and their atom equivalents). 25 tests, 66 assertions.
Also includes a regression guard for the blomstra/search compatibility
fix in #20: asserts tag filtering is passed via filter[tag] and that
filter[q] is omitted when no free-text search term is supplied.
Fixes a latent bug in DiscussionsActivityFeedController where a null
return from getRelationship() (when a post is hidden, soft-deleted, or
not in the API document's 'included' section) caused a fatal
property-access error while rendering the feed. The fallback
stdClass now sets both contentHtml and number.
Wires up composer test scripts and enables the Flarum reusable CI
workflow's backend testing job.
* chore: gitignore phpunit result cache
* Apply fixes from StyleCI
* test: add .gitkeep so tests/unit exists in CI checkout
PHPUnit exits 2 on newer PHP versions when the configured test
directory does not exist; the empty unit/ directory was not tracked
by git.
---------
Co-authored-by: StyleCI Bot <bot@styleci.io>
This was referenced Apr 20, 2026
Merged
imorland
added a commit
that referenced
this pull request
Apr 20, 2026
* docs: refresh README
- Fix dead LICENSE link (master -> 1.x) and badge label typo.
- Add backend CI status badge.
- Document the /u/{username}/posts feed added in 6391780.
- Reformat the feed list as a table and include 'requires flarum/tags'
annotations for the two tag-scoped routes.
- Add a settings table covering all five admin options.
- Note the blomstra/search compatibility behaviour with a link to #20.
- Drop the obsolete Firefox autodiscovery aside.
* docs: drop Extiverse link (service is dead)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
filter[tag]instead of embeddingtag:gambits insidefilter[q].filter[q]entirely when there is no free-text search term.Why
blomstra/searchoverridesFlarum\Api\Clientin the container (Provider.php) and hijacks any/discussionscall wherefilter[q]is set, rerouting it to/blomstra/search/discussions. That handler passesqstraight to Elasticsearch as free text — it does not parsetag:gambits — so RSS feeds that relied onfilter[q]=tag:fooreturned empty results.By moving tags to the native
filter[tag]param (handled byTagFilterGambitas aFilterInterface) and only settingfilter[q]when there is an actual search term, the request stays on core's/discussionspath on vanilla Flarum, withflarum/tags, and withblomstra/searchinstalled.Closes #17 — supersedes that PR with a cleaner implementation (no debug code, no absolute-URL workaround, correct comma-separated tag list).
Test plan
/rssreturns discussions on vanilla Flarum/rss/t/<slug>returns tag-scoped discussions withflarum/tagsonly/rssand/rss/t/<slug>both work withblomstra/searchenabled