Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid resource theme:// #128

Closed
MorphBonehunter opened this issue Feb 19, 2020 · 13 comments
Closed

Invalid resource theme:// #128

MorphBonehunter opened this issue Feb 19, 2020 · 13 comments
Assignees

Comments

@MorphBonehunter
Copy link

I've run 2 (very) small websites with grav and today i tried to enable/configure the email plugin in the admin panel on both of the installations.
But every time i try to test the Plugin i got the following error (i obfuscate the settings a little bit):

bin/plugin email test-email -t <name>@<domain>.de

Current Configuration:

array:16 [
  "enabled" => true
  "from" => "<name>@<domain>.net"
  "from_name" => null
  "to" => "<name>@<domain>.com"
  "to_name" => null
  "queue" => array:4 [
    "enabled" => false
    "flush_frequency" => "* * * * *"
    "flush_msg_limit" => 10
    "flush_time_limit" => 100
  ]
  "mailer" => array:3 [
    "engine" => "smtp"
    "smtp" => array:5 [
      "server" => "<name>.<domain>.net"
      "port" => 25
      "encryption" => "none"
      "user" => null
      "password" => null
    ]
    "sendmail" => array:1 [
      "bin" => "/usr/sbin/sendmail -bs"
    ]
  ]
  "content_type" => "text/html"
  "debug" => false
  "charset" => null
  "cc" => null
  "cc_name" => null
  "bcc" => null
  "reply_to" => null
  "reply_to_name" => null
  "body" => null
]


In UniformResourceLocator.php line 435:
                             
  Invalid resource theme://  
                             

test-email [-t|--to TO] [-e|--env [ENV]] [-s|--subject [SUBJECT]] [-b|--body [BODY]]

Both sites use the Quark theme and i have no clue what the problem could be.

@mahagr mahagr self-assigned this Feb 19, 2020
@mahagr mahagr added the bug label Feb 19, 2020
@mahagr
Copy link
Member

mahagr commented Feb 19, 2020

Are you using Grav 1.6?

@MorphBonehunter
Copy link
Author

MorphBonehunter commented Feb 19, 2020

Yes, the grav version is 1.6.21, the email plugin version is 3.0.6.

@valentin-harrang
Copy link

I have same problem, @MorphBonehunter Have you found a solution?

@pawelandrzejewski89
Copy link

pawelandrzejewski89 commented Feb 24, 2020

Same issue for Grav 1.6.21 and 'Static site generator' plugin.

It looks like its Grav core problem, and it's not related to any of plugins.

@valentin-harrang
Copy link

valentin-harrang commented Feb 24, 2020

How can the problem be corrected?

If I go to system/src/Grav/Common/Twig at line 211 and if I edit theme to themes, it works.

'theme_dir'         => $locator->findResource('theme://'),
'theme_url'         => $this->grav['base_url'] . '/' . $locator->findResource('theme://', false),

The problem is theme:// it is written in singular instead of plurial.

@rhukster
Copy link
Member

I’ll take a look at this today.

@randoum
Copy link

randoum commented Feb 26, 2020

Exact same problem here

@pawelandrzejewski89
Copy link

In case of a different plugin with same error: 'Static site generator' on Grav 1.6.21 there was easy workaround -> downgrade to 1.6.20.
In Grav 1.6.21 there's some inconsistency in documentation/vendors.

Can you confirm that downgrade to 1.6.20 also work in this case and its not plugin issue?

@randoum
Copy link

randoum commented Feb 26, 2020

Grav 1.6.21 - Email 3.0.6 (tried 3.0.5, same result)
Though it works with Grav 1.6.20 (Email 3.0.6)

Backtrace (edited) :

In UniformResourceLocator.php line 435:
                              
  [InvalidArgumentException]  
  Invalid resource theme://   
                              

Exception trace:
 () at /vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php:435
 RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator->find() at /vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php:403
 RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator->findCached() at /vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php:290
 RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator->findResource() at /system/src/Grav/Common/Twig/Twig.php:91
 Grav\Common\Twig\Twig->init() at /user/plugins/email/classes/Utils.php:33
 Grav\Plugin\Email\Utils::sendEmail() at /user/plugins/email/cli/TestEmailCommand.php:91
 Grav\Plugin\Console\TestEmailCommand->serve() at /system/src/Grav/Console/ConsoleCommand.php:41
 Grav\Console\ConsoleCommand->execute() at /vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /vendor/symfony/console/Application.php:917
 Symfony\Component\Console\Application->doRunCommand() at /vendor/symfony/console/Application.php:269
 Symfony\Component\Console\Application->doRun() at /vendor/symfony/console/Application.php:145
 Symfony\Component\Console\Application->run() at /bin/plugin:152

@mahagr
Copy link
Member

mahagr commented Feb 26, 2020

The issue is caused by this change (see CLI): https://github.com/getgrav/grav/blob/1.7/UPGRADE-1.7.md#cli-1

@mahagr
Copy link
Member

mahagr commented Feb 26, 2020

Here is the change itself getgrav/grav@48170d2

mahagr added a commit that referenced this issue Feb 27, 2020
@mahagr mahagr added the fixed label Feb 27, 2020
@mahagr
Copy link
Member

mahagr commented Feb 27, 2020

So.. Basically the reason why this (and some other plugins) CLI commands broke is because of Grav initialization was broken in older versions and they were initializing theme too early, causing issues which could not be fixed without breaking some of the CLI commands.

@MorphBonehunter
Copy link
Author

Confirm that the issue is fixed with 3.0.7:
Message sent successfully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants