Closed kaspar-allenbach closed 3 years ago
Hello kaspar,
thank you for reporting this.
Unfortunately I cannot confirm this error.
I tried it on a test system running Craft Pro 3.2.5.1 (PHP 7.1.30) and everything works fine. No problem running ./craft setup
.
Can you assure that /vendor/propaganistas/email-obfuscator/assets
exists and that CRAFT_VENDOR_PATH
is defined in your installation?
/vendor/propaganistas/email-obfuscator/assets
is present
How can I check for CRAFT_VENDOR_PATH
?
Just use Craft::info(CRAFT_VENDOR_PATH, 'test');
for the moment and take a look into the console.log
Where do I have to place this? In the index.php?
I have done some testing.
I don't get why the AssetBundle is initiated correctly when activating the plugin within the browser, but fails to do so via the console. I could not find the differences in the source code.
Can you check whether this workaround works?
// replace those 3 lines
if( $this->settings->includeJS) {
$this->view->registerAssetBundle(CraftEmailobfuscatorPropaganistasAssets::class);
}
// with these
if( $this->settings->includeJS && $this->request instanceof Craft\web\request) {
$this->view->registerAssetBundle(CraftEmailobfuscatorPropaganistasAssets::class);
}
Changes relate to the file: CraftEmailobfuscator.php
I'l test it as soon as I can. I had also extensive emails with the craft support. Oli suggested this:
Could you try to add:
use lucasbares\craftemailobfuscator\CraftEmailobfuscatorPropaganistasAssets;
At the top (below the namespace declaration) of: /vendor/lucasbares/craft-emailobfuscator/src/CraftEmailobfuscator.php Re-enable the plugin and try running a command again please?-Oli
But this had no effect.
I tried this, too.
I also moved the Asset to resources/
and renamed it to CraftEmailobfuscatorPropaganistas
and CraftEmailobfuscatorPropaganistasAssetBundle
. No effect.
My workaround just disables this part of the code, which is not necessary for installation. During a normal page call, $this->request
will be an instance of Craft\web\request
, otherwise Craft\console\request
. I did not found an easier way to check whether it is a console request. However, I do not like this solution and I think there has to be a better way of doing it.
Maybe it is just the wrong place to put this code, but I don't know where else to put this line. I would love to somehow "hook" it to the Twig filter, but since the filter is developed by someone else (a separate package I reference to) I cannot modify it.
Hey @luke-nehemedia, I added a PR that should fix this issue. Can you have a look? Thanks!
@luke-nehemedia Could you have a look at this please? Waiting on this plugin for a Craft 2 > 3 upgrade.
Hello jan! Thank's a lot! I will have a look this week!
Hey @luke-nehemedia, any updates on this?
Yes, I have an exam this Thursday and plan to look into it afterwards. I am very sorry for the delay.
Just published an update to the plugin. I hope this solves the issue.
When I have emailobfuscator installed the craft terminal no longer works.
Stuff like
./craft setup
or./craft project-config/sync
result in the following error:As you can see your plugin is mentioned in the stacktrace. If I deactivate it all is running well.
I I create a asset folder in the root it is working agin as well. Craft support assumes that: