From ada9ad5e73bc37db2cd3c0890df93b6fb9b508e6 Mon Sep 17 00:00:00 2001 From: Julio Date: Tue, 19 Oct 2021 15:49:17 +0200 Subject: [PATCH] Fix sticky migrations --- .../Migrations/Schema/V200/Version20201212195011.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php b/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php index 9df29420df..f7e457a66e 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201212195011.php @@ -81,10 +81,11 @@ final class Version20201212195011 extends AbstractMigrationChamilo $sql = "SELECT id FROM extra_field WHERE extra_field_type = $extraFieldType AND variable = 'special_course'"; $result = $connection->executeQuery($sql); - $extraFieldId = $result->fetchOne(); + $extraFieldRow = $result->fetchOne(); $specialCourses = ''; - if (!empty($extraFieldId)) { + if (!empty($extraFieldRow)) { + $extraFieldId = (int) $extraFieldRow['id']; $sql = 'SELECT DISTINCT(item_id) FROM extra_field_values WHERE field_id = '.$extraFieldId." AND value = '1'";