You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($oldVersion !== null && !$this->checkSchema($oldVersion)) {
145
+
$log = '';
146
+
if ($oldVersion !== null && !$this->checkSchema($oldVersion, $log)) {
147
+
if (!isCommandLine()) {
148
+
Session::addMessageAfterRedirect(sprintf(
149
+
__('The database schema is not consistent with the installed Formcreator %s. To see the logs run the command %s', 'formcreator'),
150
+
$oldVersion,
151
+
'bin/console glpi:plugin:install formcreator'
152
+
), false, ERROR);
153
+
} else {
154
+
echosprintf(
155
+
__('The database schema is not consistent with the installed Formcreator %s. To see the logs run the command %s', 'formcreator'),
156
+
$oldVersion,
157
+
'bin/console glpi:plugin:install formcreator'
158
+
) . PHP_EOL;
159
+
echo$log . PHP_EOL;
160
+
}
146
161
returnfalse;
147
162
}
148
163
}
@@ -189,6 +204,26 @@ public function upgrade(Migration $migration, $args = []): bool {
189
204
$task = newCronTask();
190
205
PluginFormcreatorIssue::cronSyncIssues($task);
191
206
}
207
+
208
+
// Check schema of tables after upgrade
209
+
$log = '';
210
+
if (!$this->checkSchema(PLUGIN_FORMCREATOR_VERSION, $log)) {
211
+
if (!isCommandLine()) {
212
+
Session::addMessageAfterRedirect(sprintf(
213
+
__('The database schema is not consistent with the installed Formcreator %s. To see the logs enable the plugin and run the command %s', 'formcreator'),
0 commit comments