Skip to content

Flarum\Forum\Content\Discussion overriding extension settings #199

Closed
flarum/framework
#2577
@pedrorezende

Description

@pedrorezende

Bug Report

Current Behavior
Whenever I try to extend content behavior using (new Extend\Frontend('forum'))->content(MyDispatcher::class), my callback is added before Flarum\Forum\Content\Discussion. So I can't override settings like $canonicalUrl, because they always get overwritten by the core component.

Steps to Reproduce

  1. Create an extension and add a callback to (new Extend\Frontend('forum'))->content(MyDispatcher::class)
  2. On the __invoke function, try to set $flarumDocument->canonicalUrl value
  3. Discussion pages load with a different canonical url

Expected Behavior
It would be very cool if we could prioritize the order of how extensions are executed. But for this specific issue, MyComponent@__invoke should be called after Flarum\Forum\Content\Discussion@__invoke in order to proper extend the desired functionality.

Environment

  • Flarum version: Flarum 0.1.0-beta.13
  • Webserver: php built-in server
  • Hosting environment: localhost
  • PHP version: 7.4.3
  • Browser: Chrome 84 on Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions