Closed deteh closed 9 months ago
Thanks for the report. It seems like this would have been an issue starting with Flarum 1.8.
Technically, the problem isn't my extension's fault. It's the Flarum Mentions extension that doesn't use the loadWhere
extender properly, by not accepting null
for the $request
parameter. The Likes extension has the same problem.
Since I have access to the $request
object, I will add it in an update so the code works like in Flarum itself. But we still need to do something about this in Flarum core/extensions.
Fixed in version 1.0.1. Thanks for the report.
Exception as below:
[2024-01-29 15:34:37] flarum.ERROR: TypeError: Flarum\Mentions\Api\LoadMentionedByRelationship::mutateRelation(): Argument #2 ($request) must be of type Psr\Http\Message\ServerRequestInterface, null given, called in /home/.../public_html/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php on line 238 and defined in /home/.../public_html/vendor/flarum/mentions/src/Api/LoadMentionedByRelationship.php:27 Stack trace:
0 /home/.../public_html/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(238): Flarum\Mentions\Api\LoadMentionedByRelationship::mutateRelation()
1 /home/.../public_html/vendor/illuminate/database/Eloquent/Builder.php(666): Flarum\Api\Controller\AbstractSerializeController->Flarum\Api\Controller{closure}()
2 /home/.../public_html/vendor/illuminate/database/Eloquent/Builder.php(642): Illuminate\Database\Eloquent\Builder->eagerLoadRelation()
3 /home/.../public_html/vendor/illuminate/database/Eloquent/Collection.php(60): Illuminate\Database\Eloquent\Builder->eagerLoadRelations()
4 /home/.../public_html/vendor/illuminate/database/Eloquent/Collection.php(231): Illuminate\Database\Eloquent\Collection->load()
5 /home/.../public_html/vendor/illuminate/database/Eloquent/Collection.php(206): Illuminate\Database\Eloquent\Collection->loadMissingRelation()
6 /home/.../public_html/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(246): Illuminate\Database\Eloquent\Collection->loadMissing()
7 /home/.../public_html/vendor/clarkwinkelmann/flarum-ext-collapsible-posts/src/Controller/ListCollapsedPosts.php(83): Flarum\Api\Controller\AbstractSerializeController->loadRelations()
8 /home/.../public_html/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(116): ClarkWinkelmann\CollapsiblePosts\Controller\ListCollapsedPosts->data()
9 /home/.../public_html/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractSerializeController->handle()
10 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http{closure}()
11 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ExecuteRoute->process()
12 /home/.../public_html/vendor/fof/reactions/src/Middleware/BindRequestToContainer.php(35): Laminas\Stratigility\Next->handle()
13 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): FoF\Reactions\Middleware\BindRequestToContainer->process()
14 /home/.../public_html/vendor/kilowhat/flarum-ext-audit-pro/src/Middlewares/ExtendSetPermissionController.php(19): Laminas\Stratigility\Next->handle()
15 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Kilowhat\Audit\Middlewares\ExtendSetPermissionController->process()
16 /home/.../public_html/vendor/kilowhat/flarum-ext-audit-pro/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
17 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
18 /home/.../public_html/vendor/nearata/flarum-ext-maintenance-mode/src/Middleware/AbstractMiddleware.php(50): Laminas\Stratigility\Next->handle()
19 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Nearata\MaintenanceMode\Middleware\AbstractMiddleware->process()
20 /home/.../public_html/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
21 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Api\Middleware\ThrottleApi->process()
22 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(36): Laminas\Stratigility\Next->handle()
23 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\CheckCsrfToken->process()
24 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(69): Laminas\Stratigility\Next->handle()
25 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ResolveRoute->process()
26 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
27 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\SetLocale->process()
28 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
29 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\AuthenticateWithHeader->process()
30 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
31 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\AuthenticateWithSession->process()
32 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
33 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\RememberFromCookie->process()
34 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
35 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\StartSession->process()
36 /home/.../public_html/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
37 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Api\Middleware\FakeHttpMethods->process()
38 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
39 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ParseJsonBody->process()
40 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
41 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\HandleErrors->process()
42 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
43 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\InjectActorReference->process()
44 /home/.../public_html/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(75): Laminas\Stratigility\Next->handle()
45 /home/.../public_html/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
46 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\RequestHandler->process()
47 /home/.../public_html/vendor/middlewares/base-path-router/src/BasePathRouter.php(99): Laminas\Stratigility\Next->handle()
48 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\BasePathRouter->process()
49 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
50 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Laminas\Stratigility\Middleware\OriginalMessages->process()
51 /home/.../public_html/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
52 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\BasePath->process()
53 /home/.../public_html/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
54 /home/.../public_html/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ProcessIp->process()
55 /home/.../public_html/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(75): Laminas\Stratigility\Next->handle()
56 /home/.../public_html/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(64): Laminas\Stratigility\MiddlewarePipe->process()
57 /home/.../public_html/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(73): Laminas\Stratigility\MiddlewarePipe->handle()
58 /home/.../public_html/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
59 /home/.../public_html/public/index.php(32): Flarum\Http\Server->listen()
60 {main}
Installed packages:
acpl/flarum-post-validator 0.0.2 acpl/mobile-tab 1.4.1
afrux/forum-widgets-core v0.1.7 afrux/news-widget v0.1.1 afrux/online-users-widget v0.1.6 afrux/top-posters-widget v0.1.4 antoinefr/flarum-ext-online v1.0.1 askvortsov/flarum-article-series v0.2.0 askvortsov/flarum-auto-moderator v0.1.3 askvortsov/flarum-categories v3.0.9 askvortsov/flarum-moderator-warnings v0.6.3 axy/backtrace 2.0.0 blomstra/cache-assets 0.5 blomstra/flarum-redis 0.4.2 blomstra/sort-order-toggle 0.2.0 blomstra/turnstile 0.1.4 brick/math 0.11.0 carbonphp/carbon-doctrine-types 1.0.0 clarkwinkelmann/flarum-ext-collapsible-posts 1.0.0 clarkwinkelmann/flarum-ext-colorful-borders 1.0.0 clarkwinkelmann/flarum-ext-featured-discussions 1.0.0 clarkwinkelmann/flarum-ext-likes-received 1.0.2 clarkwinkelmann/flarum-ext-popular-discussion-badge 1.1.1 clarkwinkelmann/flarum-ext-shadow-ban 1.1.0 club-1/flarum-ext-chore-commands v1.0.0 club-1/flarum-ext-cross-references v1.1.1 components/font-awesome 5.15.4 cweagans/composer-patches 1.7.3 darkle/fancybox 1.1.2 datlechin/flarum-add-like-controls v1.0.6 datlechin/flarum-bbcode-hide-content v0.1.5 datlechin/flarum-copy-links v1.0.1 datlechin/flarum-discussion-overview v0.0.1 datlechin/flarum-link-preview v1.4.0 datlechin/flarum-more-discussions v0.3.0 datlechin/flarum-signup-button v0.1.1 datlechin/flarum-silent-edit v0.1.0 datlechin/flarum-who-replied v1.0.0 davwheat/session-keepalive 1.1.0 dem13n/topic-starter-label 0.1.8 deteh/flarum-ext-online-guests 1.0.1 dflydev/dot-access-data v3.0.2 dflydev/fig-cookies v3.1.0 doctrine/cache 2.2.0 doctrine/dbal 2.13.9 doctrine/deprecations 1.1.2 doctrine/event-manager 1.2.0 doctrine/inflector 2.0.9 doctrine/lexer 1.2.3 donatello-za/rake-php-plus v1.0.18 dragonmantank/cron-expression v3.3.3 egulias/email-validator 2.1.25 fabpot/goutte v4.0.3 fgribreau/mailchecker v4.1.19 fig/http-message-util 1.1.5 filp/whoops 2.15.4 flarum/approval v1.8.1 flarum/bbcode v1.8.0 flarum/core v1.8.5 flarum/emoji v1.8.0 flarum/flags v1.8.0 flarum/lang-english v1.8.0 flarum/likes v1.8.0 flarum/lock v1.8.0 flarum/markdown v1.8.0 flarum/mentions v1.8.3 flarum/pusher v1.8.0 flarum/statistics v1.8.0 flarum/sticky v1.8.0 flarum/subscriptions v1.8.0 flarum/suspend v1.8.1 flarum/tags v1.8.0 fof/ban-ips 1.1.1 fof/byobu 1.3.5 fof/components 1.0.0 fof/custom-footer 1.1.2 fof/disposable-emails 1.0.0 fof/doorman 1.1.4 fof/drafts 1.2.10 fof/extend 1.3.3 fof/filter 1.1.3 fof/follow-tags 1.2.2 fof/formatting 1.0.3 fof/forum-statistics-widget 1.2.1 fof/gamification 1.6.7 fof/geoip 1.4.1 fof/html-errors 1.1.2 fof/ignore-users 1.2.1 fof/impersonate 1.1.1 fof/linguist 1.1.2 fof/links 1.2.2 fof/merge-discussions 1.4.1 fof/moderator-notes 1.2.2 fof/nightmode 1.5.3 fof/pages 1.0.8 fof/polls 1.4.2 fof/prevent-necrobumping 1.1.2 fof/reactions 1.3.5 fof/share-social 1.1.3 fof/sitemap 1.0.3 fof/spamblock 1.1.2 fof/split 1.1.1 fof/subscribed 1.1.4 fof/terms 1.3.0 fof/user-bio 1.3.2 fof/user-directory 1.3.3 foskym/flarum-custom-levels v1.0.3 franzl/whoops-middleware 2.0.0 glowingblue/password-strength 4.0.0 guzzlehttp/guzzle 7.8.1 guzzlehttp/promises 2.0.2 guzzlehttp/psr7 ianm/follow-users 1.4.4 ianm/log-viewer 0.1.1 illuminate/bus v8.83.27 illuminate/cache v8.83.27 illuminate/collections v8.83.27 illuminate/config v8.83.27 illuminate/console v8.83.27 illuminate/container v8.83.27 illuminate/contracts v8.83.27 illuminate/database v8.83.27 illuminate/events v8.83.27 illuminate/filesystem v8.83.27 illuminate/hashing v8.83.27 illuminate/macroable v8.83.27 illuminate/mail v8.83.27 illuminate/pipeline v8.83.27 illuminate/queue v8.83.27 illuminate/redis v8.83.27 illuminate/session v8.83.27 illuminate/support v8.83.27 illuminate/translation v8.83.27 illuminate/validation v8.83.27 illuminate/view v8.83.27 intervention/image 2.7.2 jaybizzle/crawler-detect v1.2.116 jenssegers/agent v2.6.4 jfcherng/php-color-output 3.0.0 jfcherng/php-diff 6.15.3 jfcherng/php-mb-string 2.0.1 jfcherng/php-sequence-matcher 4.0.3 justoverclock/auto-post-count-badge 1.0.0 justoverclock/be-active-user-indicator 0.1.0 justoverclock/discussion-info 0.1.5 justoverclock/events-countdown 0.1.8 justoverclock/feautured-discussions-widget 0.1.1 justoverclock/flarum-ext-feedback 0.1.9 justoverclock/flarum-ext-guestengagement 1.0.3 justoverclock/header-slideshow 0.1.1 justoverclock/user-statistics 0.1.9 justoverclock/username-blacklist 0.1.0 kilowhat/flarum-database-requirements 1.0.0 kilowhat/flarum-ext-audit-pro 1.7.0 laminas/laminas-diactoros 2.26.0 laminas/laminas-escaper 2.13.0 laminas/laminas-httphandlerrunner 2.10.0 laminas/laminas-stratigility 3.11.0 laravel/serializable-closure v1.3.3 league/commonmark 2.4.1 league/config v1.2.0 league/flysystem 1.1.10 league/mime-type-detection 1.15.0 league/uri 6.8.0 league/uri-interfaces 2.3.0 matthiasmullie/minify 1.3.71 matthiasmullie/path-converter 1.1.3 maxmind-db/reader v1.11.1 michaelbelgium/flarum-discussion-views v7.2.1 michaelbelgium/flarum-profile-views v8.0.2 middlewares/base-path v2.1.0 middlewares/base-path-router v2.0.1 middlewares/request-handler v2.0.2 middlewares/utils v3.3.0 miniflar/top-like-givers-widget 0.1.0 mobiledetect/mobiledetectlib 2.8.45 monolog/monolog 1.27.1 nearata/flarum-ext-maintenance-mode 1.0.0 nearata/flarum-ext-twofactor v2.2.1 nesbot/carbon 2.72.2 nette/schema v1.3.0 nette/utils v4.0.4 nikic/fast-route v0.6.0 noriods/auto-more v1.0.0 opis/closure 3.6.3 paragonie/constant_time_encoding v2.6.3 peruguitar/flarum-ext-user-portrait 1.0.4 predis/predis v2.2.2 psr/clock 1.0.0 psr/container 1.1.2 psr/event-dispatcher 1.0.0 psr/http-client 1.0.3 psr/http-factory 1.0.2 psr/http-message 1.1 psr/http-server-handler 1.0.2 psr/http-server-middleware 1.0.2 psr/log 1.1.4 psr/simple-cache 1.0.1 pusher/pusher-php-server 2.6.4 ralouphie/getallheaders 3.0.3 ramsey/collection 2.0.0 ramsey/uuid 4.7.5 rob006/flarum-ext-last-post-avatar 1.2.4 rob006/flarum-lang-polish v1.6.0 s9e/regexp-builder 1.4.6 s9e/sweetdom 2.1.2 s9e/text-formatter 2.14.3 spekulatius/phpscraper 1.0.2 spomky-labs/otphp 11.2.0 staudenmeir/eloquent-eager-limit v1.6.1 swiftmailer/swiftmailer v6.3.0 sycho/codecs-base64vlq 2.0.0 sycho/errors 3.0.0 sycho/flarum-move-posts v0.1.7 sycho/flarum-profile-cover v1.3.5 sycho/flarum-uikit v0.2.0 sycho/json-api v0.5.2 sycho/sourcemap 2.0.0 symfony/browser-kit v6.4.0 symfony/config v5.4.31 symfony/console v5.4.34 symfony/css-selector v6.4.0 symfony/deprecation-contracts v3.4.0 symfony/dom-crawler v6.4.0 symfony/event-dispatcher v5.4.34 symfony/event-dispatcher-contracts v3.4.0 symfony/filesystem v6.4.0 symfony/finder v5.4.27 symfony/http-client v6.2.13 symfony/http-client-contracts v3.4.0 symfony/http-foundation v5.4.34 symfony/mime v5.4.26 symfony/polyfill-ctype v1.28.0 symfony/polyfill-iconv v1.28.0 symfony/polyfill-intl-grapheme v1.28.0 symfony/polyfill-intl-idn v1.28.0 symfony/polyfill-intl-messageformatter v1.28.0 symfony/polyfill-intl-normalizer v1.28.0 symfony/polyfill-mbstring v1.28.0 symfony/polyfill-php72+ features to lower PHP versions symfony/polyfill-php73+ features to lower PHP versions symfony/polyfill-php80+ features to lower PHP versions symfony/polyfill-php81+ features to lower PHP versions symfony/process v5.4.34 symfony/service-contracts v3.4.1 symfony/string v6.4.2 symfony/translation v5.4.31 symfony/translation-contracts v2.5.2 symfony/yaml v5.4.31 the-turk/flarum-diff 1.1.2 the-turk/flarum-flamoji 1.0.4 the-turk/flarum-miserable-users 1.0.2 the-turk/flarum-quiet-edits 0.1.3 tijsverkoyen/css-to-inline-styles v2.2.7 v17development/flarum-blog v0.6.5 v17development/flarum-seo v1.8.0 v17development/flarum-user-badges v1.1.0 voku/portable-ascii 1.6.1 webmozart/assert 1.11.0 wikimedia/less.php v3.2.1 xelson/flarum-ext-chat v1.1.5! zerosonesfun/direct-links 3.1 ziiven/flarum-post-number v0.1.4