WCF icon indicating copy to clipboard operation
WCF copied to clipboard

SourceCodeFormField does not work in frontend

Open Fighter456 opened this issue 3 years ago • 0 comments

The above mentioned form field currently does not work in form builder powered forms in the frontend due to the currently missing codemirror - template in the frontends templates - folder referenced in the __sourceCodeFormField.

https://github.com/WoltLab/WCF/blob/f9f9eb3781abc53dd4d55de7cd885c5b900e9bce/com.woltlab.wcf/templates/__sourceCodeFormField.tpl#L9

Seems to be unintentionally missing in the syncTemplates.json file: https://github.com/WoltLab/WCF/blob/fcdc6318b772ca22b20f958e81a62b00916f2296/syncTemplates.json#L75-L76

Sat, 07 May 2022 20:40:04 +0000
Message: Unable to find template 'codemirror'
PHP version: 7.2.34
WoltLab Suite version: 5.5.0 Alpha 2
Request URI: GET /*REDACTED*/index.php?*REDACTED*/
Referrer: 
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15
Peak Memory Usage: 9434904/134217728
======
Error Class: wcf\system\exception\SystemException
Error Message: Unable to find template 'codemirror'
Error Code: 0
File: /Users/dennis/Sites/localhost/*REDACTED*/lib/system/template/TemplateEngine.class.php (379)
Extra Information: YToxOntpOjA7YToyOntpOjA7czoxNjoiVGVtcGxhdGUgQ29udGV4dCI7aToxO3M6NzczOiJ1bnNldCgkdGhpcy0+Zm9yZWFjaFZhcnNbJ2I5MjdjMzJiNGUwZTc2MzE3NDdkNmIwMDE2YTAxZDNmMTNhOTI0M2UnXSk7CiB9ID8+PD9waHAgaWYgKCAhICR0aGlzLT52WydmaWVsZCddLT5jaGVja0RlcGVuZGVuY2llcygpKSB7ID8+IHN0eWxlPSJkaXNwbGF5OiBub25lOyI8P3BocCB9ID8+PgoJPGR0Pjw/cGhwIGlmICgkdGhpcy0+dlsnZmllbGQnXS0+Z2V0TGFiZWwoKSAhPT0gbnVsbCkgeyA/PjxsYWJlbCBmb3I9Ijw/PSR0aGlzLT52WydmaWVsZCddLT5nZXRQcmVmaXhlZElkKCk7Pz4iPjw/PSR0aGlzLT52WydmaWVsZCddLT5nZXRMYWJlbCgpOz8+PC9sYWJlbD48P3BocCBpZiAoJHRoaXMtPnZbJ2ZpZWxkJ10tPmlzUmVxdWlyZWQoKSAmJiAkdGhpcy0+dlsnZm9ybSddLT5tYXJrc1JlcXVpcmVkRmllbGRzKCkpIHsgPz4gPHNwYW4gY2xhc3M9ImZvcm1GaWVsZFJlcXVpcmVkIj4qPC9zcGFuPjw/cGhwIH0gPz48P3BocCB9ID8+PC9kdD4KCTxkZD4KPT09PT4gCQk8Pz0kdGhpcy0+dlsnZmllbGQnXS0+Z2V0RmllbGRIdG1sKCk7Pz4KCQkKCQk8P3BocCBpZiAoJHRoaXMtPnZbJ2ZpZWxkJ10tPmdldERlc2NyaXB0aW9uKCkgIT09IG51bGwpIHsgPz4KCTxzbWFsbD48Pz0kdGhpcy0+dlsnZmllbGQnXS0+Z2V0RGVzY3JpcHRpb24oKTs/Pjwvc21hbGw+Cjw/cGhwIH0gPz4KCQk8P3BocAokX2ZvcmVhY2hfN2JkM2QxNWEzMTc0Y2NiMzNmZGUxYWJlNGM2MjVlYjRhN2VhY2EwMSA9ICR0aGlzLT52WydmaWVsZCddLT5nZXRWYWxpZGF0aW9uRXJyb3JzKCk7CiI7fX0=
Stack Trace: [{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateScriptingCompiler.class.php","line":1112,"function":"getSourceFilename","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["codemirror","wcf"]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateScriptingCompiler.class.php","line":513,"function":"compileIncludeTag","class":"wcf\\system\\template\\TemplateScriptingCompiler","type":"->","args":[" file='codemirror' codemirrorMode=$field->getLanguage() codemirrorSelector='#'|concat:$field->getPrefixedId()","__sourceCodeFormField",{"application":"[redacted]","data":"[redacted]","filename":"[redacted]"}]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateScriptingCompiler.class.php","line":371,"function":"compileTag","class":"wcf\\system\\template\\TemplateScriptingCompiler","type":"->","args":["include file='codemirror' codemirrorMode=$field->getLanguage() codemirrorSelector='#'|concat:$field->getPrefixedId()","__sourceCodeFormField",{"application":"[redacted]","data":"[redacted]","filename":"[redacted]"}]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateCompiler.class.php","line":35,"function":"compileString","class":"wcf\\system\\template\\TemplateScriptingCompiler","type":"->","args":["__sourceCodeFormField","<textarea id=\"{@$field->getPrefixedId()}\" name=\"{@$field->getPrefixedId()}\" {if !$field->getFieldClasses()|empty} class=\"{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{\/implode}\"{\/if}{if $field->isRequired()} required{\/if}{if $field->isAutofocused()} autofocus{\/if}{if $field->isImmutable()} disabled{\/if}{if $field->getMinimumLength() !== null} minlength=\"{$field->getMinimumLength()}\"{\/if}{if $field->getMaximumLength() !== null} maxlength=\"{$field->getMaximumLength()}\"{\/if}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}=\"{$attributeValue}\"{\/foreach}>{$field->getValue()}<\/textarea>\n\n{include file='codemirror' codemirrorMode=$field->getLanguage() codemirrorSelector='#'|concat:$field->getPrefixedId()}\n\n<script data-relocate=\"true\">\n    (() => {\n        document.getElementById('{@$field->getPrefixedId()}').parentNode.dir = 'ltr';\n    })();\n<\/script>\n",{"application":"[redacted]","data":"[redacted]","filename":"[redacted]"}]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateEngine.class.php","line":493,"function":"compile","class":"wcf\\system\\template\\TemplateCompiler","type":"->","args":["__sourceCodeFormField","<textarea id=\"{@$field->getPrefixedId()}\" {*\n    *}name=\"{@$field->getPrefixedId()}\" {*\n    *}{if !$field->getFieldClasses()|empty} class=\"{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{\/implode}\"{\/if}{*\n    *}{if $field->isRequired()} required{\/if}{*\n    *}{if $field->isAutofocused()} autofocus{\/if}{*\n    *}{if $field->isImmutable()} disabled{\/if}{*\n    *}{if $field->getMinimumLength() !== null} minlength=\"{$field->getMinimumLength()}\"{\/if}{*\n    *}{if $field->getMaximumLength() !== null} maxlength=\"{$field->getMaximumLength()}\"{\/if}{*\n    *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}=\"{$attributeValue}\"{\/foreach}{*\n*}>{$field->getValue()}<\/textarea>\n\n{include file='codemirror' codemirrorMode=$field->getLanguage() codemirrorSelector='#'|concat:$field->getPrefixedId()}\n\n<script data-relocate=\"true\">\n    (() => {\n        document.getElementById('{@$field->getPrefixedId()}').parentNode.dir = 'ltr';\n    })();\n<\/script>\n","\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/templates\/compiled\/0_wcf_1___sourceCodeFormField.php",{"application":"[redacted]","data":"[redacted]","filename":"[redacted]"}]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/lib\/system\/template\/TemplateEngine.class.php","line":339,"function":"compileTemplate","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__sourceCodeFormField","\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/templates\/__sourceCodeFormField.tpl","\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/templates\/compiled\/0_wcf_1___sourceCodeFormField.php",{"application":"[redacted]","data":"[redacted]","filename":"[redacted]"}]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateEngine.class.php","line":590,"function":"display","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__sourceCodeFormField","wcf",false]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/form\/builder\/field\/AbstractFormField.class.php","line":118,"function":"fetch","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__sourceCodeFormField","wcf",{"field":"[redacted]"},true]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/templates\/compiled\/0_wcf_1___formField.php","line":38,"function":"getFieldHtml","class":"wcf\\system\\form\\builder\\field\\AbstractFormField","type":"->","args":[]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/lib\/system\/template\/TemplateEngine.class.php","line":346,"args":["\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/templates\/compiled\/0_wcf_1___formField.php"],"function":"include","class":"","type":""},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateEngine.class.php","line":590,"function":"display","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__formField","wcf",false]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/form\/builder\/field\/AbstractFormField.class.php","line":135,"function":"fetch","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__formField","wcf",{"field":"[redacted]"},true]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/templates\/compiled\/0_wcf_1___form.php","line":106,"function":"getHtml","class":"wcf\\system\\form\\builder\\field\\AbstractFormField","type":"->","args":[]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/lib\/system\/template\/TemplateEngine.class.php","line":346,"args":["\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/templates\/compiled\/0_wcf_1___form.php"],"function":"include","class":"","type":""},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateEngine.class.php","line":590,"function":"display","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__form","wcf",false]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/form\/builder\/FormDocument.class.php","line":449,"function":"fetch","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["__form","wcf",{"form":"[redacted]"}]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/templates\/compiled\/0_*REDACTED* _1_propertyMaintenanceTemplateAdd.php","line":1521,"function":"getHtml","class":"wcf\\system\\form\\builder\\FormDocument","type":"->","args":[]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/template\/TemplateEngine.class.php","line":346,"args":["\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/templates\/compiled\/0_*REDACTED* _1_propertyMaintenanceTemplateAdd.php"],"function":"include","class":"","type":""},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/page\/AbstractPage.class.php","line":390,"function":"display","class":"wcf\\system\\template\\TemplateEngine","type":"->","args":["propertyMaintenanceTemplateAdd","*REDACTED* "]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/page\/AbstractPage.class.php","line":135,"function":"show","class":"wcf\\page\\AbstractPage","type":"->","args":[]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/lib\/system\/request\/Request.class.php","line":90,"function":"__run","class":"wcf\\page\\AbstractPage","type":"->","args":[]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED*\/lib\/system\/request\/RequestHandler.class.php","line":105,"function":"execute","class":"wcf\\system\\request\\Request","type":"->","args":[]},{"file":"\/Users\/dennis\/Sites\/localhost\/*REDACTED* \/*REDACTED* \/index.php","line":12,"function":"handle","class":"wcf\\system\\request\\RequestHandler","type":"->","args":["*REDACTED*"]}]```

Fighter456 avatar May 07 '22 21:05 Fighter456