diff --git a/wire/modules/System/SystemUpdater/SystemUpdate18.php b/wire/modules/System/SystemUpdater/SystemUpdate18.php new file mode 100644 index 00000000..01e2c1cc --- /dev/null +++ b/wire/modules/System/SystemUpdater/SystemUpdate18.php @@ -0,0 +1,24 @@ +wire()->addHookAfter('ProcessWire::ready', $this, 'executeAtReady'); + return 0; // indicates we will update system version ourselves when ready + } + public function executeAtReady() { + foreach($this->wire()->fields as $field) { + if($field->type instanceof FieldtypeFile) { + try { + $field->type->getDatabaseSchema($field); + } catch(\Exception $e) { } + } + } + $this->updater->saveSystemVersion(18); + } +} + diff --git a/wire/modules/System/SystemUpdater/SystemUpdater.module b/wire/modules/System/SystemUpdater/SystemUpdater.module index 51e26435..2d98e241 100644 --- a/wire/modules/System/SystemUpdater/SystemUpdater.module +++ b/wire/modules/System/SystemUpdater/SystemUpdater.module @@ -5,7 +5,7 @@ * * ProcessWire System Helper Module * - * ProcessWire 3.x, Copyright 2019 by Ryan Cramer + * ProcessWire 3.x, Copyright 2020 by Ryan Cramer * https://processwire.com * * @method coreVersionChange($fromVersion, $toVersion) @@ -26,8 +26,8 @@ class SystemUpdater extends WireData implements Module, ConfigurableModule { * This version number is important, as this updater keeps the systemVersion up with this version * */ - 'version' => 17, - ); + 'version' => 18, + ); } protected $configData = array( @@ -35,7 +35,7 @@ class SystemUpdater extends WireData implements Module, ConfigurableModule { // can represent anything about the system that's related to the individual installation. // 0 = the first version when this module was created, should remain there. 'systemVersion' => 0, - ); + ); /** * Number of updates that were applied during this request