Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Matias Griese
2021-09-14 18:28:16 +03:00
3 changed files with 8 additions and 2 deletions

View File

@@ -8,6 +8,9 @@
* Added support for `flex-required@: not exists` and `flex-required@: '!exists'` in blueprints * Added support for `flex-required@: not exists` and `flex-required@: '!exists'` in blueprints
* Added `$object->getOriginalData()` to get flex objects data before it was modified with `update()` * Added `$object->getOriginalData()` to get flex objects data before it was modified with `update()`
* Throwing exceptions from Twig templates fires `onDisplayErrorPage.[code]` event allowing better error pages * Throwing exceptions from Twig templates fires `onDisplayErrorPage.[code]` event allowing better error pages
2. [](#improved)
* Use a simplified text-based `cron` field for scheduler
* Add timestamp to logging output of scheduler jobs to see when they ran
3. [](#bugfix) 3. [](#bugfix)
* Fixed escaping in PageIndex::getLevelListing() * Fixed escaping in PageIndex::getLevelListing()
* Fixed validation of `number` type [#3433](https://github.com/getgrav/grav/issues/3433) * Fixed validation of `number` type [#3433](https://github.com/getgrav/grav/issues/3433)

View File

@@ -47,7 +47,8 @@ form:
label: PLUGIN_ADMIN.EXTRA_ARGUMENTS label: PLUGIN_ADMIN.EXTRA_ARGUMENTS
placeholder: '-lah' placeholder: '-lah'
.at: .at:
type: cron type: text
wrapper_classes: cron-selector
label: PLUGIN_ADMIN.SCHEDULER_RUNAT label: PLUGIN_ADMIN.SCHEDULER_RUNAT
help: PLUGIN_ADMIN.SCHEDULER_RUNAT_HELP help: PLUGIN_ADMIN.SCHEDULER_RUNAT_HELP
placeholder: '* * * * *' placeholder: '* * * * *'

View File

@@ -390,7 +390,9 @@ class Job
if (count($this->outputTo) > 0) { if (count($this->outputTo) > 0) {
foreach ($this->outputTo as $file) { foreach ($this->outputTo as $file) {
$output_mode = $this->outputMode === 'append' ? FILE_APPEND | LOCK_EX : LOCK_EX; $output_mode = $this->outputMode === 'append' ? FILE_APPEND | LOCK_EX : LOCK_EX;
file_put_contents($file, $this->output, $output_mode); $timestamp = (new DateTime('now'))->format('c');
$output = $timestamp . "\n" . str_pad('', strlen($timestamp), '>') . "\n" . $this->output;
file_put_contents($file, $output, $output_mode);
} }
} }