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

assets:generate-presets broken if queue=sync #3501

Closed
tbruckmaier opened this issue Apr 8, 2021 · 2 comments · Fixed by #3511
Closed

assets:generate-presets broken if queue=sync #3501

tbruckmaier opened this issue Apr 8, 2021 · 2 comments · Fixed by #3511
Labels

Comments

@tbruckmaier
Copy link

Bug Description

assets:generate-presets runs into an error, if default queue is sync. Probably related to #3490?

How to Reproduce

Set 'default' => 'sync', in config/app.php and run php please assets:generate-presets

$ php please assets:generate-presets -v

   Error 

  Call to undefined method Statamic\Jobs\GeneratePresetImageManipulation::dispatchSync()

  at vendor/statamic/cms/src/Console/Commands/AssetsGeneratePresets.php:109
    105|             foreach ($this->imageAssets as $asset) {
    106|                 $bar->setMessage($asset->basename(), 'filename');
    107| 
    108|                 $dispatchMethod = $this->shouldQueue ? 'dispatch' : 'dispatchSync';
  > 109|                 GeneratePresetImageManipulation::$dispatchMethod($asset, $preset);
    110| 
    111|                 $bar->advance();
    112|             }
    113| 

  1   vendor/statamic/cms/src/Console/Commands/AssetsGeneratePresets.php:74
      Statamic\Console\Commands\AssetsGeneratePresets::generatePresets([])

  2   vendor/statamic/cms/src/Console/Commands/AssetsGeneratePresets.php:56
      Statamic\Console\Commands\AssetsGeneratePresets::generateUserPresets()

  3   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Statamic\Console\Commands\AssetsGeneratePresets::handle()

  4   vendor/laravel/framework/src/Illuminate/Container/Util.php:37
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  5   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  6   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  7   vendor/laravel/framework/src/Illuminate/Container/Container.php:596
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  8   vendor/laravel/framework/src/Illuminate/Console/Command.php:134
      Illuminate\Container\Container::call()

  9   vendor/symfony/console/Command/Command.php:256
      Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  10  vendor/laravel/framework/src/Illuminate/Console/Command.php:121
      Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  11  vendor/symfony/console/Application.php:971
      Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  12  vendor/symfony/console/Application.php:290
      Symfony\Component\Console\Application::doRunCommand(Object(Statamic\Console\Commands\AssetsGeneratePresets), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  13  vendor/symfony/console/Application.php:166
      Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  14  vendor/laravel/framework/src/Illuminate/Console/Application.php:93
      Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  15  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
      Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  16  please:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Extra Detail

Environment

Statamic version: 3.1.5

PHP version: 7.4

Install method (choose one):

  • Fresh install from statamic/statamic
  • Starter kit
  • Existing Laravel app
  • Other (please explain this magic!)
@robdekort
Copy link
Contributor

Probably due to one of the latest update where the command became queueable.

@jasonvarga
Copy link
Member

Ah you must be using an earlier version of Laravel. My mistake, I didn't realize that was a new method. Thanks for the report!

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

Successfully merging a pull request may close this issue.

4 participants