View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007640 | module Visual CMS | module Visual CMS - sub | public | 2024-04-23 15:49 | 2024-12-10 11:43 |
Reporter | SimonGassenschmidt | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | won't fix | ||
Product Version | 3.6.2 | ||||
Summary | 0007640: Module extending smarty-block visualcms_shortcodes_options breaks since 3.6.2 | ||||
Description | Since update to 3.6.2 a module overriding and loading parent with [{$smarty.block.parent}] breaks in line of $__label|addslashes|replace:'\\\'':'\''|oxescape where it cannot finde __label with such error message: [uncaught error] [type E_USER_ERROR] [file [...]/vendor/smarty/smarty/libs/Smarty.class.php] [line 1099] [code ] [message Smarty error: [in ddoevisualcmsadmin.tpl line 140]: syntax error: unrecognized tag: $__label|addslashes|replace:'\\'':'\''|oxescape (Smarty_Compiler.class.php, line 440)] This error with the same module doesn't occur in 3.6.1. This error is only triggerd, if you use [{$smarty.block.parent}] | ||||
Steps To Reproduce | Install 6.5.4 Install Visual CMS with Version 3.6.2 with composer require ddoe/visualcms-module:"3.6.2 as 3.6.1" Install smartytest modul, see attached Try to access Visual CMS | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
|
The cause lies in the inheritance by [{$smarty.block.parent}]. The quotation marks of "replace" are converted into HTML entities. As a result, "replace" no longer works and the $_label variable becomes invalid, which leads to an error. A simple workaround to avoid this would be to write a new Smarty plugin: As a module: https://docs.oxid-esales.com/developer/en/6.5/development/modules_components_themes/module/skeleton/metadataphp/amodule/smartyPluginDirectories.html For testing: vendor/oxid-esales/oxideshop-ce/source/Core/Smarty/Plugin/modifier.vcmscategoriesescape.php With the content: function smarty_modifier_vcmscategoriesescape($sString) { $sString = str_replace('\\\'', '\'', $sString); return $sString; } And replace the lines 138 and 142 in ddoevisualcmsadmin.tpl: [{$_label|addslashes|replace:'\\\'':'\''|oxescape}] with [{$_label|addslashes|vcmscategoriesescape|oxescape}] |
|
Smarty is no longer supported |