Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Sep 7, 2024
1 parent e9e724e commit 1a1d161
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
44 changes: 16 additions & 28 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@

// Manager

/**
* yform.
*
* @author jan.kristinus[at]redaxo[dot]org Jan Kristinus
* @author <a href="http://www.yakamara.de">www.yakamara.de</a>
*/

/**
* @var rex_plugin $this
* @psalm-scope-this rex_plugin
*/

$table = rex_sql_table::get(rex::getTable('yform_table'));
$hasMassDeletion = $table->hasColumn('mass_deletion');
$hasMassEdit = $table->hasColumn('mass_edit');
Expand Down Expand Up @@ -148,18 +136,18 @@

$c = rex_sql::factory();
$c->setQuery(
'ALTER TABLE `' . rex::getTable('yform_table') . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
'ALTER TABLE `' . rex::getTable('yform_table') . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;',
);
$c->setQuery(
'ALTER TABLE `' . rex::getTable('yform_field') . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
'ALTER TABLE `' . rex::getTable('yform_field') . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;',
);
$c->setQuery(
'ALTER TABLE `' . rex::getTable('yform_history') . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
'ALTER TABLE `' . rex::getTable('yform_history') . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;',
);
$c->setQuery(
'ALTER TABLE `' . rex::getTable(
'yform_history_field'
) . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
'yform_history_field',
) . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;',
);

// from 4.0 on, but on every reinstall
Expand All @@ -169,16 +157,16 @@
$perms = str_replace('"yform_manager_table":', '"yform_manager_table_edit":', (string) $role['perms']);
rex_sql::factory()->setQuery(
'UPDATE ' . rex::getTablePrefix() . 'user_role SET perms=? where id=?',
[$perms, $role['id']]
[$perms, $role['id']],
);
}
}

try {
rex_sql::factory()->setQuery(
'UPDATE ' . rex::getTable(
'yform_field'
) . ' SET `format` = "" WHERE type_name = "datestamp" AND `format` = "mysql"'
'yform_field',
) . ' SET `format` = "" WHERE type_name = "datestamp" AND `format` = "mysql"',
);
} catch (rex_sql_exception $e) {
}
Expand All @@ -197,7 +185,7 @@
// remove these fields
rex_sql::factory()->setQuery(
'delete from `' . rex::getTable('yform_field') . '` where id = :id',
['id' => $field['id']]
['id' => $field['id']],
);
break;

Expand All @@ -208,13 +196,13 @@
try {
rex_sql::factory()->setQuery(
'update ' . rex::getTable(
'yform_field'
'yform_field',
) . ' set type_name = ? where type_id="value" and type_name = ?',
[$field_new_name, $field_old_name]
[$field_new_name, $field_old_name],
);
rex_sql::factory()->setQuery(
'update ' . rex::getTable('yform_history_field') . ' set field = ? where field = ?',
[$field_new_name, $field_old_name]
[$field_new_name, $field_old_name],
);
} catch (rex_sql_exception $e) {
}
Expand All @@ -227,13 +215,13 @@
try {
rex_sql::factory()->setQuery(
'update ' . rex::getTable(
'yform_field'
'yform_field',
) . ' set type_name = ? where type_id="value" and type_name = ?',
[$field_new_name, $field_old_name]
[$field_new_name, $field_old_name],
);
rex_sql::factory()->setQuery(
'update ' . rex::getTable('yform_history_field') . ' set field = ? where field = ?',
[$field_new_name, $field_old_name]
[$field_new_name, $field_old_name],
);
} catch (rex_sql_exception $e) {
}
Expand All @@ -245,7 +233,7 @@
'update `' . rex::getTable('yform_field') . '` set
type_name = "number", db_type = "", `default` = ""
where id = :id',
['id' => $field['id']]
['id' => $field['id']],
);
break;

Expand Down
2 changes: 1 addition & 1 deletion lib/yform/value/uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class rex_yform_value_uuid extends rex_yform_value_abstract
{
public function preValidateAction(): void
{
if(rex_get('func', 'string') == "clone") {
if ('clone' == rex_get('func', 'string')) {
// Beim Klonen eine neue UUID generieren
$this->setValue(self::guidv4());
} elseif ('' != $this->getValue()) {
Expand Down

0 comments on commit 1a1d161

Please sign in to comment.