@@ -35,19 +35,15 @@ public function shouldRun(): bool
35
35
return false ;
36
36
}
37
37
38
- // ToDo: Rewrite
39
- /*$columns = $schemaManager->listTableColumns('tl_theme');
38
+ $ columns = $ schemaManager ->listTableColumns ('tl_theme ' );
40
39
41
- if (!isset($columns['themeConfig'])) {
42
- return false;
43
- }*/
44
-
45
- try {
46
- $ test = $ this ->connection ->fetchOne ("SELECT TRUE FROM tl_theme WHERE `themeConfig` NOT LIKE '%article-spacing-small%' LIMIT 1 " );
47
- } catch (\Exception ) {
40
+ if (!isset ($ columns ['themeconfig ' ]))
41
+ {
48
42
return false ;
49
43
}
50
44
45
+ $ test = $ this ->connection ->fetchOne ("SELECT TRUE FROM tl_theme WHERE `themeConfig` NOT LIKE '% \"article-spacing-small%' LIMIT 1 " );
46
+
51
47
if (false !== $ test )
52
48
{
53
49
return true ;
@@ -61,11 +57,7 @@ public function shouldRun(): bool
61
57
*/
62
58
public function run (): MigrationResult
63
59
{
64
- $ values = $ this ->connection ->fetchAllKeyValue ("
65
- SELECT id, `themeConfig`
66
- FROM tl_theme
67
- WHERE `themeConfig` NOT LIKE '%article-spacing-small%'
68
- " );
60
+ $ values = $ this ->connection ->fetchAllKeyValue ("SELECT id, themeconfig FROM tl_theme WHERE themeconfig NOT LIKE '% \"article-spacing-small%' " );
69
61
70
62
foreach ($ values as $ id => $ value )
71
63
{
@@ -90,9 +82,9 @@ public function run(): MigrationResult
90
82
91
83
private function setAndUpdateConfigVariable (string $ newKey , string $ oldKey , array &$ config ): void
92
84
{
93
- if (isset ( $ config [ $ oldKey ]) && !isset ($ config [$ newKey ]))
85
+ if (!isset ($ config [$ newKey ]))
94
86
{
95
- $ config [$ newKey ] = $ config [$ oldKey ];
87
+ $ config [$ newKey ] = $ config [$ oldKey ] ?? ' a:2:{s:4:"unit";s:3:"rem";s:5:"value";s:3:"2.5";} ' ;
96
88
$ config [$ oldKey ] = '$ ' .$ newKey ;
97
89
}
98
90
}
0 commit comments