New answers tagged

0

Guessing you didn't do step #4 in the readme? https://github.com/panlatent/schedule/blob/master/README.md Add a record to system crontab: * * * * * php /path/to/craft schedules/run 1>> /dev/null 2>&1


1

Your code looks like it actually has a further problem that you're only fetching the first order for a given user. Rather than eager loading (which is basically creating joins so that the relevant data is fetched in one go), why not use a hash map to look up each customer's set of orders? So, outside your users loop, create a separate query to fetch all ...


2

I got help on Discord. The way to do it was Calendar::getInstance()->events->saveEvent($event); Edit: DateTime also needs to be replaced with Carbon()


1

I believe the answer is to roll my own archiving method – archived elements results in them not being accessible in element indexes.


1

Allright, after digging & debugging a bit further into this issue I found it out myself! $event->sender->addErrors([ 'expiryDate' => Template::raw('<a href='.$entry[0]->cpEditUrl.'>'.$entry[0]->title.'</a>') ]); PS: don't forget to add this to the top of your php file: use craft\helpers\Template;


2

I figured it out! Field-specific options need to go inside 'typesettings'. 'typesettings' => [ 'options' => [ ['label' => 'H1', 'value' => 'h1', 'default' => 1], ['label' => 'H2', 'value' => 'h2', 'default' => ''], ['label' => 'H3', 'value' => 'h3', 'default' => ''] ] ]


Top 50 recent answers are included