Closed davola closed 2 years ago
From the stack trace, it looks like the issue is coming from modules\customRedactorConfig\Module
. Can you post that module’s code?
oh! That module trace skipped my eyes.
here is the code
# modules\customRedactorConfig\Module.php
<?php
namespace modules\customRedactorConfig;
use craft\redactor\events\RegisterLinkOptionsEvent;
use craft\redactor\Field as RedactorField;
use yii\base\Event;
class Module extends \yii\base\Module
{
/**
* Initializes the module.
*/
public function init()
{
// Remove "Link to..." Redactor links
Event::on(
RedactorField::class,
RedactorField::EVENT_REGISTER_LINK_OPTIONS,
function(RegisterLinkOptionsEvent $event) {
// Only apply to a specific Redactor config
if ('OnlyDefinedLinks.json' == $event->sender->redactorConfig) {
// Remove Craft's injected links
$event->linkOptions = [];
}
}
);
}
}
Thank you!
Oh! You are a genius @brandonkelly. You were right, the controller namespace initialization was missing on this Module.
I have added the following on top and it works perfect now:
if (\Craft::$app->getRequest()->getIsConsoleRequest()) {
$this->controllerNamespace = 'modules\\console\\controllers';
} else {
$this->controllerNamespace = 'modules\\controllers';
}
Sorry for the inconvenience and thank you so much for dedicating the time to see this. Your product Craft is awesome! 💪
Closing this now, Thanks! 🙏
Glad you got it sorted!
What happened?
Description
When trying to see the available list of commands we have in craft, it fails with the following error:
According with the
\yii\base\Module::getControllerPath
method help docsit seems we fail to provide the needed alias namespace for this to work properly.
Steps to reproduce
php craft
and hit enterExpected behavior
It should list all the available commands that Craft has
Actual behavior
It shows the following YII error:
Craft CMS version
Craft Pro 3.7.44
PHP version
8.0.20
Operating system and version
Linux 4.19.104-microsoft-standard
Database type and version
postgres
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-35)
Installed plugins and versions