File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,10 @@ public function getExcludes($contentType)
162162 private function getMinificationExcludeValues ($ key )
163163 {
164164 $ configValues = $ this ->scopeConfig ->getValue ($ key , $ this ->scope ) ?? [];
165-
165+ //compatibility fix for type change from string to array
166+ if (!is_array ($ configValues )) {
167+ $ configValues = [$ configValues => $ configValues ];
168+ }
166169 return array_values ($ configValues );
167170 }
168171}
Original file line number Diff line number Diff line change @@ -195,6 +195,8 @@ public function isMinifiedFilenameDataProvider()
195195 }
196196
197197 /**
198+ * Test dev/js/minify_exclude system value as array
199+ *
198200 * @return void
199201 */
200202 public function testGetExcludes ()
@@ -213,4 +215,23 @@ public function testGetExcludes()
213215 /** check cache: */
214216 $ this ->assertEquals ($ expected , $ this ->minification ->getExcludes ('js ' ));
215217 }
218+
219+ /**
220+ * Test dev/js/minify_exclude system value backward compatibility when value was a string
221+ *
222+ * @return void
223+ */
224+ public function testGetExcludesTinyMceAsString ()
225+ {
226+ $ this ->scopeConfigMock
227+ ->expects ($ this ->once ())
228+ ->method ('getValue ' )
229+ ->with ('dev/js/minify_exclude ' )
230+ ->willReturn ('/tiny_mce/ ' );
231+
232+ $ expected = ['/tiny_mce/ ' ];
233+ $ this ->assertEquals ($ expected , $ this ->minification ->getExcludes ('js ' ));
234+ /** check cache: */
235+ $ this ->assertEquals ($ expected , $ this ->minification ->getExcludes ('js ' ));
236+ }
216237}
You can’t perform that action at this time.
0 commit comments