[4.1 Alpha 3] Template code editor illegal offset exception 'return' when previewing/saving. Preview content not updating until create new page button pressed.
In one specific area, If I attempt to create a template, an error exception is displayed when previewing or saving the page:
ErrorException: [E_WARNING] Illegal string offset 'return' in src/addons/vw/vw/_core/model/parser/handle/vw.php at line 95
This exception occurs even if the editor is left empty. It is thrown also regardless of whether the page title field has been filled in or not. In other words, the error occurs before the form is being validated for the required fields. Normal page content types (but still with template code editor) do not run into the error exception.
Code:
XF::handlePhpError() in src/addons/vw/vw/_core/model/parser/handle/vw.php at line 95
vw_Parser_Handle_Model->handle_bbcode_link() in src/addons/vw/vw/_core/model/parser/handle/wrapper/vw.php at line 184
vw_Parser_Handle_Wrapper_Model->bbcode_wrapper()
call_user_func() in src/XF/BbCode/Renderer/Html.php at line 296
XF\BbCode\Renderer\Html->renderTag() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 423
vw\vw\BbCode\Renderer\Plain->renderTag() in src/XF/BbCode/Traverser.php at line 61
XF\BbCode\Traverser->renderSubTree() in src/addons/vw/vw/_core/model/parser/handle/wrapper/xf2.php at line 76
vw_Parser_Handle_Wrapper_Model_XF2->format_args() in src/addons/vw/vw/_core/model/parser/handle/wrapper/vw.php at line 189
vw_Parser_Handle_Wrapper_Model->vwcode_wrapper()
call_user_func() in src/XF/BbCode/Renderer/Html.php at line 296
XF\BbCode\Renderer\Html->renderTag() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 423
vw\vw\BbCode\Renderer\Plain->renderTag() in src/XF/BbCode/Traverser.php at line 61
XF\BbCode\Traverser->renderSubTree() in src/addons/vw/vw/_core/model/parser/handle/wrapper/xf2.php at line 76
vw_Parser_Handle_Wrapper_Model_XF2->format_args() in src/addons/vw/vw/_core/model/parser/handle/wrapper/vw.php at line 167
vw_Parser_Handle_Wrapper_Model->bbcode_wrapper()
call_user_func() in src/XF/BbCode/Renderer/Html.php at line 296
XF\BbCode\Renderer\Html->renderTag() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 423
vw\vw\BbCode\Renderer\Plain->renderTag() in src/XF/BbCode/Traverser.php at line 61
XF\BbCode\Traverser->renderSubTree() in src/addons/vw/vw/_core/model/parser/handle/wrapper/xf2.php at line 76
vw_Parser_Handle_Wrapper_Model_XF2->format_args() in src/addons/vw/vw/_core/model/parser/handle/wrapper/vw.php at line 189
vw_Parser_Handle_Wrapper_Model->vwcode_wrapper()
call_user_func() in src/XF/BbCode/Renderer/Html.php at line 296
XF\BbCode\Renderer\Html->renderTag() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 423
vw\vw\BbCode\Renderer\Plain->renderTag() in src/XF/BbCode/Traverser.php at line 61
XF\BbCode\Traverser->renderSubTree() in src/XF/BbCode/Traverser.php at line 37
XF\BbCode\Traverser->renderAst() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 157
vw\vw\BbCode\Renderer\Plain->renderAst() in src/XF/BbCode/Traverser.php at line 20
XF\BbCode\Traverser->render() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 152
vw\vw\BbCode\Renderer\Plain->vwParentRender() in src/addons/vw/vw/BbCode/Renderer/Plain.php at line 106
vw\vw\BbCode\Renderer\Plain->vwRender() in src/addons/vw/vw/_core/instance/parser/renderer/xf2.php at line 326
vw_Parser_Renderer_Instance_XF2->render() in src/addons/vw/vw/_core/model/parser/instance/xf2.php at line 190
vw_Parser_Instance_Model_XF2->parse() in src/addons/vw/vw/_core/model/parser/instance/vw.php at line 266
vw_Parser_Instance_Model->get_preview() in src/addons/vw/vw/_core/model/parser/instance/xf2.php at line 237
vw_Parser_Instance_Model_XF2->get_preview() in src/addons/vw/vw/_core/model/string/vw.php at line 681
vw_String_Model->summarize() in src/addons/vw/vw/_core/controller/dm/revision/vw.php at line 1085
vw_DM_Revision_Controller->pre_save() in src/addons/vw/vw/XF/Entity/Entity.php at line 619
vw\vw\XF\Entity\Entity->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1297
XF\Mvc\Entity\Entity->preSave() in src/addons/vw/vw/XF/Entity/Entity.php at line 610
vw\vw\XF\Entity\Entity->vwPreSave() in src/addons/vw/vw/_core/controller/dm/xf2.php at line 329
vw_DM_Controller_XF2->pre_save() in src/addons/vw/vw/_core/controller/dm/page/vw.php at line 2523
vw_DM_Page_Controller->internal_pre_save() in src/addons/vw/vw/_core/controller/dm/page/vw.php at line 1025
vw_DM_Page_Controller->process_revision() in src/addons/vw/vw/_core/controller/dm/page/vw.php at line 785
vw_DM_Page_Controller->pre_save() in src/addons/vw/vw/XF/Entity/Entity.php at line 619
vw\vw\XF\Entity\Entity->_preSave() in src/XF/Mvc/Entity/Entity.php at line 1297
XF\Mvc\Entity\Entity->preSave() in src/addons/vw/vw/XF/Entity/Entity.php at line 610
vw\vw\XF\Entity\Entity->vwPreSave() in src/addons/vw/vw/_core/controller/dm/xf2.php at line 329
vw_DM_Controller_XF2->pre_save() in src/addons/vw/vw/_core/controller/ui/edit/page/vw.php at line 494
vw_UI_Edit_Page_Controller->start_dm() in src/addons/vw/vw/_core/controller/ui/edit/page/xf0.php at line 21
vw_UI_Edit_Page_Controller_XF0->start_dm() in src/addons/vw/vw/_core/controller/ui/edit/vw.php at line 149
vw_UI_Edit_Controller->save() in src/addons/vw/vw/_core/controller/ui/create/vw.php at line 432
vw_UI_Create_Controller->publish() in src/addons/vw/vw/_core/controller/ui/area/vw.php at line 145
vw_UI_Area_Controller->publish() in src/addons/vw/vw/_core/controller/ui/area/vw.php at line 47
vw_UI_Area_Controller->execute() in src/addons/vw/vw/_core/controller/ui/stack/vw.php at line 261
vw_UI_Stack_Controller->execute() in src/addons/vw/vw/Pub/Controller/Wiki/Wiki.php at line 80
vw\vw\Pub\Controller\Wiki\Wiki->_actionIndex() in src/addons/vw/vw/Mvc/Dispatcher.php at line 30
vw\vw\Mvc\Dispatcher::dispatch() in src/addons/vw/vw/Pub/Controller/Wiki/AbstractController.php at line 26
vw\vw\Pub\Controller\Wiki\AbstractController->actionIndex() in src/XF/Mvc/Dispatcher.php at line 321
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
XF\App->run() in src/XF.php at line 390
XF::runApp() in index.php at line 20
But back to the one area with issues. I have run into an issue where the template code editor is shown on the edit screen, regardless of the content type. Page, Category, Book, Attachment, Anonymous Page are all affected. Other areas do not experience this behaviour and the editor changes to Froala (bbcode) as is appropriate for the content type.
EDIT: As identified in the comments below, this part isn't a bug as it relates to parsing HTML content in this area.
FWIW, the funky template problem that I reported in
issue 5735 belongs to this same Area. Could these two issues be related in some way?
The VaultWiki installation that this was experienced on is XF2.1 based and for testing only. I will likely reinstall VW from scratch once a non-Alpha version is available. I don't need to retain any information from the test install.