• 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
    • Template public:thread_view error: Call to a member function canView() on null

    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: Template public:thread_view error: Call to a member function canView() on null

    • Issue Tools
      • View Changes
    1. issueid=6174 February 23, 2021 9:58 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Template public:thread_view error: Call to a member function canView() on null

      After enabling widget wiki similar content:

      Error: Template public:thread_view error: Call to a member function canView() on null src/addons/vw/vw/_core/model/ui/tab/thread/xf2.php:26

      Generated by: Alfa Feb 23, 2021 at 2:15 PM

      Stack trace

      #0 src/XF.php(589): vw_UI_Tab_Thread_Model_XF2->{closure}()
      #1 src/addons/vw/vw/_core/model/ui/tab/thread/xf2.php(27): XF::asVisitor(Object(SV\ReportImprovements\XF\Entity\User ), Object(Closure))
      #2 src/addons/vw/vw/_core/model/ui/tab/vw.php(55): vw_UI_Tab_Thread_Model_XF2->can_main_tab(Array, Array)
      #3 src/addons/vw/vw/_core/model/ui/vw.php(59): vw_UI_Tab_Model->check('can_main_tab', Array, Array)
      #4 src/addons/vw/vw/Handler/Widget/Generic.php(148): vw_UI_Model->check('can_main_tab', Object(SV\ReportImprovements\XF\Entity\Thread))
      #5 internal_data/code_cache/widgets/_53_wikisimc.php(5): vw\vw\Handler\Widget\Generic->render()
      #6 src/XF/Template/Templater.php(7402): XF\SubContainer\Widget->{closure}(Object(SV\StandardLib\XF\Template\Templater) , Array, Array)
      #7 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
      #8 src/XF/Template/Templater.php(1901): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
      #9 src/addons/vw/vw/XF/Template/Templater.php(1023): XF\Template\Templater->widgetPosition('thread_view_bel...', Array)
      #10 internal_data/code_cache/templates/l1/s6/public/thread_view.php(983): vw\vw\XF\Template\Templater->widgetPosition('thread_view_bel...', Array)
      #11 src/XF/Template/Templater.php(1626): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater) , Array, Object(XF\Template\ExtensionSet))
      #12 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
      #13 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
      #14 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
      #15 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
      #16 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
      #17 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
      #18 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
      #19 src/XF.php(488): XF\App->run()
      #20 index.php(20): XF::runApp('XF\\Pub\\App')
      #21 {main}

      Request state

      array(4) {
      ["url"] => string(52) "/index.php?threads/24888/"
      ["referrer"] => bool(false)
      ["_GET"] => array(1) {
      ["threads/24888/"] => string(0) ""
      }
      ["_POST"] => array(0) {
      }
      }
    Issue Details
    Issue Number 6174
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Widgets / Sideblocks
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 4.1.1
    Fixed Version 4.1.2
    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. February 23, 2021 3:23 PM
      pegasus pegasus is offline
      VaultWiki Team
      The wiki's similar content widget should not be used in non-wiki widget positions. This widget only accepts a wiki page as a source for determining what is similar. In a thread context, it will have no effect.

      The error here is due to a bug in the handling when the context is an unexpected type due to the incompatible position. I believe it would happen for any wiki widget used in a thread-related widget position. However, some wiki widgets (just not similar content) should be renderable in that position. In src/addons/vw/vw/Handler/Widget/Generic.php, find:
      Code:
      		if (!$item OR empty($item['itemtypeid']))
      		{
      			$item = \vw_Hard_Core::controller('Fetch')->get('Index', 0);
      		}
      AFTER it, add:
      Code:
      		if (is_a($item, '\XF\Mvc\Entity\Entity'))
      		{
      			$tmp = $item->toArray();
      			$tmp['xfEntity'] = $item;
      			$item = $tmp;
      		}
      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 2:41 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.