Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#3204 by jossnaz
16 Aug 2016, 23:41
i am getting this error when trying to run the cronjob for the emails.



Code: Select all#16 {main} Error while trying to send payment e-mail for order ID "9" and status "6": Template "email/common/text-salutation-header-default.php" not available

Trace: #0 /var/www/html/myapp/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Standard.php(219): Aimeos\MW\View\Standard->resolve(Array)
#1 /var/www/html/myapp/ext/ai-client-html/client/html/src/Client/Html/Email/Payment/Text/Salutation/Standard.php(167): Aimeos\MW\View\Standard->render(Array)
#2 /var/www/html/myapp/ext/ai-client-html/client/html/src/Client/Html/Email/Payment/Text/Standard.php(187): Aimeos\Client\Html\Email\Payment\Text\Salutation\Standard->getHeader('', Array, NULL)
#3 /var/www/html/myapp/ext/ai-client-html/client/html/src/Client/Html/Email/Payment/Standard.php(152): Aimeos\Client\Html\Email\Payment\Text\Standard->getHeader('', Array, NULL)
#4 /var/www/html/myapp/ext/ai-client-html/controller/jobs/src/Controller/Jobs/Order/Email/Payment/Standard.php(159): Aimeos\Client\Html\Email\Payment\Standard->getHeader()
#5 /var/www/html/myapp/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(60): Aimeos\Controller\Jobs\Order\Email\Payment\Standard->run()
#6 [internal function]: Aimeos\Shop\Command\JobsCommand->fire()
#7 /var/www/html/myapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#8 /var/www/html/myapp/vendor/laravel/framework/src/Illuminate/Console/Command.php(150): Illuminate\Container\Container->call(Array)
#9 /var/www/html/myapp/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/myapp/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/myapp/vendor/symfony/console/Application.php(841): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/myapp/vendor/symfony/console/Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(Aimeos\Shop\Command\JobsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/myapp/vendor/symfony/console/Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/myapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/myapp/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))



i run the cronjobs from the scheduler:
Code: Select all<?php

namespace Ffix\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
  /**
   * The Artisan commands provided by your application.
   *
   * @var array
   */
  protected $commands = [
    Commands\Inspire::class,
  ];

  /**
   * Define the application's command schedule.
   *
   * @param  \Illuminate\Console\Scheduling\Schedule $schedule
   * @return void
   */
  protected function schedule(Schedule $schedule)
  {

    $minuteCronJobLog = base_path() . '/storage/logs/cronjob_minute.log';
    $hourCronJobLog = base_path() . '/storage/logs/cronjob_hour.log';
    $dayCronJobLog = base_path() . '/storage/logs/cronjob_day.log';
    $outPutDateTimeFn = function () {
      $date = date('Y-m-d H:i:s');
      echo $date . ': ';
    };
    $schedule->command('aimeos:jobs "order/email/delivery order/email/payment order/service/delivery"')
      ->everyMinute()
      ->before($outPutDateTimeFn)
      ->appendOutputTo($minuteCronJobLog);

    $schedule->command('aimeos:jobs "customer/email/watch order/cleanup/unfinished order/service/async order/service/payment"')
      ->hourly()
      ->before($outPutDateTimeFn)
      ->appendOutputTo($hourCronJobLog);

    $schedule->command('aimeos:jobs "admin/cache admin/log order/cleanup/unpaid product/bought index/rebuild index/optimize"')
      ->daily()
      ->before($outPutDateTimeFn)
      ->appendOutputTo($dayCronJobLog);

  }
}


any idea why it cannot find the template file?

it certainly is there

`ff-laravel/ext/ai-client-html/client/html/templates/email/common/text-salutation-header-default.php` exists


my shop.php
Code: Select all  'client' => array(
    'html' => array(
      'common' => array(
        'content' => array(
          'baseurl' => 'http://ffix.local/',

        ),
        'template' => array(
          'baseurl' => public_path('packages/aimeos/shop/elegance'),
        ),
      ),
      'email' => array(
        'from-email' => 'hithere+testaimeos@gmail.com',
        'from-name' => 'Test Aimeos',
      ),
    ),
  ),



just another debug:

`ff-laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Standard.php`

$this->path is:
Code: Select allarray (
  '/var/www/html/fixturefix/ext/ai-controller-jobs' =&gt;
  array (
    0 =&gt; 'controller/jobs/templates',
  ),
)


hope it helps

so the folder aimeos is trying to access is this: (debug from resolve() function of the View)

`/home/myuser/IdeaProjects/myapp/ff-laravel/ext/ai-controller-jobs/controller/jobs/templates/email/payment/5/text-salutation-header-default.php`

this is obviously wrong. Even though i call it from a controller, it should look in a different folder.... someone can shed some light into this?
#3216 by aimeos
19 Aug 2016, 19:35
jossnaz wrote:after downgrading and seeing it work, i upgraded again


There was a mismatch between the new outsourcedt ai-client-html extension and the Laravel integration. We've fixed that and have released a new minor version of the HTML client.

jossnaz wrote:i must say, I am not very impressed.


Aimeos is a community project and lives from its contributors. Like Laravel, we release often to get new versions early to the users. This may lead to bugs that are quickly fixed and compared to Laravel, the number of bugfix releases is quite small. If you need a rock solid version, you should use the Aimeos LTS version.

Cheers

Andi
#3223 by jossnaz
19 Aug 2016, 20:54
aimeos wrote: If you need a rock solid version, you should use the Aimeos LTS version.

Cheers

Andi


i thought stable somehow means that someone at least tested it once. For people wondering about LTS... it would be good if you leave a note about it on the installation page. I didn't know there exists LTS for aimeos

https://aimeos.org/project/roadmap/

so we can expect LTS at 2016.09?


another recommendation:

Change the name of the forum link to "forum" and not "help"

go to https://www.amazon.com/ and click on help. That is what one expects from a help link. I never knew the forum existed until i found a post for an error i had. And i was like "oh there is a forum, so i don't have to post issues to github..."
#3242 by aimeos
20 Aug 2016, 21:07
jossnaz wrote:i thought stable somehow means that someone at least tested it once. For people wondering about LTS... it would be good if you leave a note about it on the installation page. I didn't know there exists LTS for aimeos


You ran into a problem that only surfaces when using the demo data. In real projects nobody noticed that up to now because this combination isn't used there.

We have unit tests for 90% of the code but sadly, that doesn't say that it's bug free. Some areas are hard to test automatically because there are too much dependencies like in this case (create an order in the frontend, run the Laravel jobs on the console). Our tests always include frontend and backend but not always the jobs. This is something where we may need to get better.

We will add a hint about this. The current LTS version is Aimeos 1.2 for Laravel from October last year.

jossnaz wrote:so we can expect LTS at 2016.09?


The next LTS release will be 2016.10 in the first half of October. The new big features has been implemented in the first half of this year so we are mainly polishing the current stable version to get it as bug free as possible and update the documentation.

jossnaz wrote:Change the name of the forum link to "forum" and not "help"


OK, that's a good hint. Thanks!