• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • [4.1 Alpha 3] Template code editor illegal offset exception 'return' when previewing/saving. Preview content not updating until create new page button pressed.

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: [4.1 Alpha 3] Template code editor illegal offset exception 'return' when previewing/saving. Preview content not updating until create new page button pressed.

    • Issue Tools
      • View Changes
    1. issueid=5736 May 3, 2019 6:21 AM
      ACL ACL is offline
      Regular Member
      [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.
    Issue Details
    Issue Number 5736
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Editing Pages
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 4.1.0 Alpha 3
    Fixed Version 4.1.0 Beta 1
    Milestone (none)
    Software DependencyXenForo 2.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. May 3, 2019 11:47 AM
      pegasus pegasus is offline
      VaultWiki Team
      In the area settings, Parsing Options > Parse the following in Pages > HTML might be checked.

      I am only able to reproduce this exception if my template includes a FILE tag. In this case, the exception is now fixed in the next release.
      Reply Reply  
    2. May 3, 2019 12:01 PM
      ACL ACL is offline
      Regular Member
      HTML might be checked
      Ah yes, of course. Staring me right in the face! This test area is a dedicated place for templates and some templates do need to parse HTML.

      With this area's HTML setting turned off, the correct bbcode editor is used for non-template pages. However, the error exception (Illegal string offset 'return') still happens when creating a template (with or without content entered in the editor).
      Reply Reply  
    3. May 4, 2019 9:32 AM
      ACL ACL is offline
      Regular Member
      I have some more testing details which may help.

      With a create new template page open, the 'Illegal string offset' error exception is thrown when "Preview" is clicked first. If "Create New Page" is clicked first, the form is validated (leave the title empty to prevent saving the page). Previewing the template now works. However, the preview content is not updated until "Create New page" is clicked again (again, with title left empty). Create New Page and then Preview needs to be clicked in that order to show an updated preview.

      If these steps do not throw an exception for you, then perhaps your fix for the FILE case also fixes this template issue.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 1:19 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.