From 4a6d344ab63350f0f4ed81d3b62ccbd773624e45 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Mon, 28 Jan 2019 11:37:18 +0100 Subject: [PATCH] FIX: Do not migrate already migrated validators --- Migrations/Code/Version20170603120900.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Migrations/Code/Version20170603120900.php b/Migrations/Code/Version20170603120900.php index 7e53d87..33318b6 100644 --- a/Migrations/Code/Version20170603120900.php +++ b/Migrations/Code/Version20170603120900.php @@ -28,15 +28,20 @@ class Version20170603120900 extends AbstractMigration */ public function up() { - $this->processConfiguration(Package::CONFIGURATION_TYPE_VALIDATION, + $this->processConfiguration( + Package::CONFIGURATION_TYPE_VALIDATION, function (&$configuration) { foreach ($configuration as $validatorName => &$validators) { + // guard that protects configuration, which has already the new format: + if (isset($validators['properties']) || isset($validators['self'])) { + continue; + } $newConfiguration = ['properties' => [], 'self' => []]; foreach ($validators as $key => &$validator) { if (! isset($validator['validator']) || ! isset($validator['options'])) { $this->showWarning('The Validation.yaml files contained no validator or options for ' . - 'validation: "' . $validatorName . '.' . $key . '". It was not be migrated.'); + 'validation: "' . $validatorName . '.' . $key . '". It was not migrated.'); continue; } if (isset($validator['property'])) {