• 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
    • Fatal Error after updating search-related add-on

    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: Fatal Error after updating search-related add-on

    • Issue Tools
      • View Changes
    1. issueid=6345 October 13, 2022 8:21 AM
      gerryvz gerryvz is offline
      New Member
      Fatal Error after updating search-related add-on

      I recently updated the "Search Improvements" add-on by developer "Xon" from version 2.4.6 to 2.6.2. This is on XenForo 2.2.11 (latest version that I updated yesterday).

      Upon completing the upgrade of the above-mentioned add-on, my forum started immediately throwing the following errors, numerous errors very quickly. I had 26 errors generated in the space of about 1 minute, so I had to disable VaultWiki to stop the constant stream of error generation.

      ErrorException: Fatal Error: Declaration of vw\vw\XF\Search\Search::isValidContentType($type) must be compatible with SV\SearchImprovements\XF\Search\SearchPatch::isValidConte ntType($type): bool src/addons/vw/vw/XF/Search/Search.php:19
      Generated by: E420 97 W210 Oct 13, 2022 at 7:58 AM

      Stack trace
      #0 [internal function]: XF::handleFatalError()
      #1 {main}

      Request state
      array(4) {
      ["url"] => string(58) "/forums/threads/w210-e420-ignition-fault-codes-help.18205/"
      ["referrer"] => string(82) "https://www.500eboard.co/forums/threads/w210-e420-ignition-fault-codes-help.18205/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
      }
    Issue Details
    Issue Number 6345
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category General
    Status Forum Bug
    Priority 4 - Warnings / Script Errors
    Affected Version 4.1.5
    Fixed Version (none)
    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. October 13, 2022 11:08 AM
      pegasus pegasus is offline
      VaultWiki Team
      It looks like this error is caused by Xon's addon. Unless Xon has access to a future version of XenForo that changed its code, the code in XenForo 2.2.11's \XF\Search\Search class is as follows:
      Code:
      public function isValidContentType($type)
      Which has no type-hinting.

      Xon's \SV\SearchImprovements\XF\Search\SearchPatch seems to replace that class with its own, but changes the declaration to be incompatible:
      Code:
      public function isValidContentType($type): bool
      Even though Xon bypasses the error somehow, it breaks other add-ons that expect XenForo's declaration to be the default.
      You can certainly edit the code in VaultWiki, but Xon should actually fix their add-on's code in order to restore the compatibility with most add-ons.

      It is possible this was an honest mistake by Xon. It seems like phpStorm incorrectly lists this method as typehinted with :bool in the Structure tab, even though the actual code of that method has no typehinting.
      Reply Reply  
    2. October 14, 2022 11:49 AM
      gerryvz gerryvz is offline
      New Member
      Hi Pegasus,

      I referred Xon to this thread and your notes, and he did indicate that it was an error on his part. He issued a bug-fix version this morning and all seems to be working well with it.

      Thank you for reviewing the errors and interpreting things. And I'm glad Xon recognized a bug and fixed it.

      Regards,
      Gerry
      Reply Reply  
    3. October 19, 2022 10:29 AM
      gerryvz gerryvz is offline
      New Member
      Hello Pegasus,

      Is this error below, ALSO related to these Xon ElasticSearch related add-ons?




      Error: Class "vw_DM__Controller" not found src/addons/vw/vw/XF/Entity/EntityBase.php:256

      Generated by: TUnger Oct 18, 2022 at 8:02 PM

      Stack trace

      #0 src/addons/vw/vw/XF/Entity/EntityBase.php(69): vw\vw\XF\Entity\EntityBase->_construct_delayed(Object(vw_DM_Controller_XF2))
      #1 src/addons/vw/vw/XF/Entity/EntityBase.php(86): vw\vw\XF\Entity\EntityBase->__construct(Object(XF\Mvc\Entity\Manager), Object(XF\Mvc\Entity\Structure))
      #2 src/XF/Mvc/Entity/Manager.php(72): vw\vw\XF\Entity\EntityBase::getStructure(Object(XF\Mvc\En tity\Structure))
      #3 src/addons/SV/ElasticSearchEssentials/XF/Search/Search.php(323): XF\Mvc\Entity\Manager->getEntityStructure('vw\\vw\\XF\\Entity...')
      #4 src/XF/ResultSet.php(230): SV\ElasticSearchEssentials\XF\Search\Search->getResultSetData('vwpage', Array, true, Array)
      #5 src/XF/ResultSet.php(214): XF\ResultSet->loadResultsData(true)
      #6 src/XF/ResultSet.php(183): XF\ResultSet->limitToViewableResults()
      #7 src/XF/ResultSet.php(193): XF\ResultSet->sliceResults(0, '200', true)
      #8 src/XF/Search/Search.php(216): XF\ResultSet->limitResults('200', true)
      #9 src/XF/Search/Search.php(181): XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Searc h\Query\KeywordQuery), '200', Object(Closure), true)
      #10 src/XF/Repository/Search.php(33): XF\Search\Search->search(Object(SV\ElasticSearchEssentials\XF\Search\Query \KeywordQuery))
      #11 src/addons/SV/ElasticSearchEssentials/XF/Repository/Search.php(39): XF\Repository\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Qu ery\KeywordQuery), Array, true)
      #12 src/addons/SV/ElasticSearchEssentials/Repository/SearchTrait.php(245): SV\ElasticSearchEssentials\XF\Repository\Search->SV\ElasticSearchEssentials\XF\Repository\{closure}(Objec t(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery ), Array, true)
      #13 src/addons/SV/ElasticSearchEssentials/XF/Repository/Search.php(35): SV\ElasticSearchEssentials\XF\Repository\Search->wrapRunSearchForSvEss(Object(Closure), Object(SV\ElasticSearchEssentials\XF\Search\Query\Keyword Query), Array, true)
      #14 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Search.php(628): SV\ElasticSearchEssentials\XF\Repository\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Qu ery\KeywordQuery), Array, true)
      #15 src/XF/Pub/Controller/Search.php(119): SV\ElasticSearchEssentials\XF\Pub\Controller\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Qu ery\KeywordQuery), Array)
      #16 src/addons/SV/SearchImprovements/XF/Pub/Controller/Search.php(71): XF\Pub\Controller\Search->actionSearch()
      #17 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Search.php(461): SV\SearchImprovements\XF\Pub\Controller\Search->actionSearch()
      #18 src/XF/Mvc/Dispatcher.php(352): SV\ElasticSearchEssentials\XF\Pub\Controller\Search->actionSearch(Object(XF\Mvc\ParameterBag))
      #19 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Search', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Searc h), NULL)
      #20 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Searc h), NULL)
      #21 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #22 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
      #23 src/XF.php(524): XF\App->run()
      #24 index.php(20): XF::runApp('XF\\Pub\\App')
      #25 {main}

      Request state

      array(4) {
      ["url"] => string(21) "/forums/search/search"
      ["referrer"] => string(32) "https://www.500eboard.co/forums/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(3) {
      ["keywords"] => string(15) "Workshop manual"
      ["c"] => array(1) {
      ["users"] => string(0) ""
      }
      ["_xfToken"] => string(8) "********"
      }
      }
      Reply Reply  
    4. October 19, 2022 1:06 PM
      pegasus pegasus is offline
      VaultWiki Team
      In AdminCP > Development > Content types, find vwpage -> entity, and delete the entry. It is sad that Xon's add-on is not respecting vwpage's custom search handler for ::getContent, but if that entry is gone, then Xon's add-on should stop giving this message and use the custom method as VaultWiki intends.

      This content-type entry is only here for 1 part of the XenForo code which can be worked around using PHP code instead. In src/addons/vw/vw/XF/Service/Tag/Changer.php, find:
      Code:
      parent::__construct($app, $contentType, $context);
      AFTER it, add:
      Code:
      		if ($this->vwIdField)
      		{
      			$id = $this->vwEntity->controller->instance->get($this->vwIdField);
      
      			if ($id)
      			{
      				$this->setContentId($id);
      			}
      		}
      That should make sure that content-tags on wiki pages can still be edited even though the "entity" field was removed.
      Reply Reply  
    5. October 24, 2022 9:45 AM
      gerryvz gerryvz is offline
      New Member
      Any thoughts about this error? It also appears to be related to Xon's ElasticSearch Essentials add-on?

      I have alerted him to it, but interested in your thoughts / confirmation that it is related to his add-on.



      Error: Class "vw_DM__Controller" not found src/addons/vw/vw/XF/Entity/EntityBase.php:256

      Generated by: Jason Brown Oct 24, 2022 at 8:30 AM

      Stack trace

      #0 src/addons/vw/vw/XF/Entity/EntityBase.php(69): vw\vw\XF\Entity\EntityBase->_construct_delayed(Object(vw_DM_Controller_XF2))
      #1 src/addons/vw/vw/XF/Entity/EntityBase.php(86): vw\vw\XF\Entity\EntityBase->__construct(Object(XF\Mvc\Entity\Manager), Object(XF\Mvc\Entity\Structure))
      #2 src/XF/Mvc/Entity/Manager.php(72): vw\vw\XF\Entity\EntityBase::getStructure(Object(XF\Mvc\En tity\Structure))
      #3 src/addons/SV/ElasticSearchEssentials/XF/Search/Search.php(323): XF\Mvc\Entity\Manager->getEntityStructure('vw\\vw\\XF\\Entity...')
      #4 src/XF/ResultSet.php(230): SV\ElasticSearchEssentials\XF\Search\Search->getResultSetData('vwpage', Array, true, Array)
      #5 src/XF/ResultSet.php(214): XF\ResultSet->loadResultsData(true)
      #6 src/XF/ResultSet.php(183): XF\ResultSet->limitToViewableResults()
      #7 src/XF/ResultSet.php(193): XF\ResultSet->sliceResults(0, '200', true)
      #8 src/XF/Search/Search.php(216): XF\ResultSet->limitResults('200', true)
      #9 src/XF/Search/Search.php(181): XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Searc h\Query\KeywordQuery), '200', Object(Closure), true)
      #10 src/XF/Repository/Search.php(33): XF\Search\Search->search(Object(SV\ElasticSearchEssentials\XF\Search\Query \KeywordQuery))
      #11 src/addons/SV/ElasticSearchEssentials/XF/Repository/Search.php(39): XF\Repository\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Qu ery\KeywordQuery), Array, true)
      #12 src/addons/SV/ElasticSearchEssentials/Repository/SearchTrait.php(245): SV\ElasticSearchEssentials\XF\Repository\Search->SV\ElasticSearchEssentials\XF\Repository\{closure}(Objec t(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery ), Array, true)
      #13 src/addons/SV/ElasticSearchEssentials/XF/Repository/Search.php(35): SV\ElasticSearchEssentials\XF\Repository\Search->wrapRunSearchForSvEss(Object(Closure), Object(SV\ElasticSearchEssentials\XF\Search\Query\Keyword Query), Array, true)
      #14 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Search.php(628): SV\ElasticSearchEssentials\XF\Repository\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Qu ery\KeywordQuery), Array, true)
      #15 src/XF/Pub/Controller/Search.php(119): SV\ElasticSearchEssentials\XF\Pub\Controller\Search->runSearch(Object(SV\ElasticSearchEssentials\XF\Search\Qu ery\KeywordQuery), Array)
      #16 src/addons/SV/SearchImprovements/XF/Pub/Controller/Search.php(71): XF\Pub\Controller\Search->actionSearch()
      #17 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Search.php(461): SV\SearchImprovements\XF\Pub\Controller\Search->actionSearch()
      #18 src/XF/Mvc/Dispatcher.php(352): SV\ElasticSearchEssentials\XF\Pub\Controller\Search->actionSearch(Object(XF\Mvc\ParameterBag))
      #19 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'Search', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Searc h), NULL)
      #20 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Searc h), NULL)
      #21 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #22 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
      #23 src/XF.php(524): XF\App->run()
      #24 index.php(20): XF::runApp('XF\\Pub\\App')
      #25 {main}

      Request state

      array(4) {
      ["url"] => string(21) "/forums/search/search"
      ["referrer"] => string(55) "https://www.500eboard.co/forums/whats-new/posts/717949/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(3) {
      ["keywords"] => string(12) "500E igniter"
      ["c"] => array(1) {
      ["users"] => string(0) ""
      }
      ["_xfToken"] => string(8) "********"
      }
      }
      Reply Reply  
    6. October 24, 2022 9:46 AM
      gerryvz gerryvz is offline
      New Member
      I was not able to find a "Development" area within the XenForo Admin CP, so I could not make that change.

      Adding the code above to the VW file also resulted in a system warning (but I sort of expected this).
      Reply Reply  
    7. October 24, 2022 12:55 PM
      pegasus pegasus is offline
      VaultWiki Team
      Yeah, this is the same error message as before, and it is caused when an add-on like Xon's assumes that another add-on's content-type "entity" field is safe to use however they want. In VaultWiki, this field is only intended to be used for type-hinting in XenForo's default Tag\Changer service. All other default uses of this field are inside content-type field handlers, and VaultWiki writes its own handlers.

      Xon's add-on is ignoring the fact that VaultWiki and other add-ons might implement custom handlers for search, which leads to an error in VaultWiki.

      I believe it would be possible for Xon's add-on to avoid this issue by:
      - When finding the entity field, also compare the content-type's search handler. If the search handler is using the default XenForo method for ::getContent, then it is safe for Xon to implement their method. If the search handler is using a non-default method for ::getContent, then it is unsafe for Xon to implement their method, and they should fall back to the search handler's custom method instead.

      I believe that this test can be performed with something like:
      Code:
      $reflector = new \ReflectionMethod($handler, 'getContent');
      $isSafe = ($reflector->getDeclaringClass()->getName() == '\XF\Search\Data\AbstractData');
      But this would have to be tested.

      As mentioned in my previous post, VaultWiki can also resolve this conflict because there is another workaround for our usage of the "entity" field. But your forum needs to be placed into in development mode via src/config.php in order to access the Development menu and remove the entry.
      Code:
      $config['development']['enabled'] = true;
      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 9:31 AM.
    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.