diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2023-11-07 10:17:04 +0000 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2023-11-07 10:17:04 +0000 |
| commit | 34b0fa8011896659e4ac32d45714f6e811b448fc (patch) | |
| tree | f42f76092a2e38883e269ee63da9dd841533498a /db | |
| parent | b6762569751780e5870d549cd3a3fa755d03fe52 (diff) | |
drop config option for disabling the ckeditor, fixes #3227
Closes #3227
Merge request studip/studip!2276
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.5.5_drop_wysiwyg_config.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/db/migrations/5.5.5_drop_wysiwyg_config.php b/db/migrations/5.5.5_drop_wysiwyg_config.php new file mode 100644 index 0000000..ae86e59 --- /dev/null +++ b/db/migrations/5.5.5_drop_wysiwyg_config.php @@ -0,0 +1,39 @@ +<?php + +class DropWysiwygConfig extends Migration +{ + public function description() + { + return 'Drop config option for disabling the ckeditor'; + } + + public function up() + { + $settings = [ + 'WYSIWYG', + 'WYSIWYG_DISABLED' + ]; + + $query = 'DELETE `config`, `config_values` + FROM `config` LEFT JOIN `config_values` USING (`field`) + WHERE `field` IN (?)'; + DBManager::get()->execute($query, [$settings]); + } + + public function down() + { + $query = 'INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)'; + $statement = DBManager::get()->prepare($query); + $statement->execute([ + ':name' => 'WYSIWYG', + ':description' => 'Aktiviert den WYSIWYG Editor im JavaScript.', + ':section' => 'global', + ':range' => 'global', + ':type' => 'boolean', + ':value' => '1' + ]); + + // WYSIWYG_DISABLED did not exist as a setting in the DB + } +} |
