I have an plugin installed in Craft that makes changes to the headers of Craft. I wrote a module to make changes to the headers AFTER the plugin made it’s changes. However the event in my plugin is called BEFORE the plugin is making its changes. The plugin itself has no triggers so I cannot call those.
My module:
<?php
namespace modulesfixseoservice;
use Craft;
use yiibaseModule;
use yiibaseEvent;
use craftwebApplication;
class fixSeoService extends Module
{
public function init() {
parent::init();
Craft::setAlias('@fix-seo-service', __DIR__);
Event::on(
Application::class,
Application::EVENT_AFTER_REQUEST,
[$this, 'removeCanonical'],
null,
false
);
}
public function removeCanonical ()
{
Craft::error( 'try remove', __METHOD__);
Craft::$app->getResponse()->getHeaders()->remove( 'Link' );
}
}
Is there a way to determine the order in which the events are triggered? Currently it just seems that the plugin is loaded before my module and I cannot change that order within the events.
Cheers!