• 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
    • Deleting a Wiki moderator leads to an error and remain unsuccesful with invalidArgumentException: A content type and ID must be provided

    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: Deleting a Wiki moderator leads to an error and remain unsuccesful with invalidArgumentException: A content type and ID must be provided

    • Issue Tools
      • View Changes
    1. issueid=6304 July 27, 2022 2:18 AM
      wolven wolven is offline
      New Member
      Deleting a Wiki moderator leads to an error and remain unsuccesful with invalidArgumentException: A content type and ID must be provided
      ArgumentException whilst trying to remove a wiki area moderator

      Hi folks, this affects 4.1.4 and 4.1.5.

      While I try to clean up the moderators, I can't remove a moderator who also is wiki area mod. The message is:



      I
      Code:
      nvalidArgumentException: A content type and ID must be provided src/XF/Service/UpdatePermissions.php:58 
      
        
      
      Stack-Trace
      
      #0 src/XF/Entity/ModeratorContent.php(57): XF\Service\UpdatePermissions->setContent('vwarea', 0)
      #1 src/addons/vw/vw/XF/Entity/ModeratorContent.php(60): XF\Entity\ModeratorContent->_postDelete()
      #2 src/XF/Mvc/Entity/Entity.php(1654): vw\vw\XF\Entity\ModeratorContent->_postDelete()
      #3 src/XF/ControllerPlugin/Delete.php(18): XF\Mvc\Entity\Entity->delete()
      #4 src/XF/Admin/Controller/Moderator.php(326): XF\ControllerPlugin\Delete->actionDelete(Object(vw\vw\XF\Entity\ModeratorContent), '/stage1/admin.p...', '/stage1/admin.p...', '/stage1/admin.p...', 'JPP (Wiki area ...')
      #5 src/XF/Mvc/Dispatcher.php(352): XF\Admin\Controller\Moderator->actionContentDelete(Object(XF\Mvc\ParameterBag))
      #6 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Moderator', 'Contentdelete', Object(XF\Mvc\RouteMatch), Object(vw\vw\XF\Admin\Controller\Moderator), NULL)
      #7 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(vw\vw\XF\Admin\Controller\Moderator), NULL)
      #8 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
      #9 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
      #10 src/XF.php(524): XF\App->run()
      #11 admin.php(13): XF::runApp('XF\\Admin\\App')
      #12 {main}
      
      Status der Anfrage
      
      array(4) {
        ["url"] => string(46) "/stage1/admin.php?moderators/content/13/delete"
        ["referrer"] => string(53) "https://xf2t.tt-board.eu/stage1/admin.php?moderators/"
        ["_GET"] => array(1) {
          ["moderators/content/13/delete"] => string(0) ""
        }
        ["_POST"] => array(4) {
          ["_xfToken"] => string(8) "********"
          ["_xfRequestUri"] => string(29) "/stage1/admin.php?moderators/"
          ["_xfWithData"] => string(1) "1"
          ["_xfResponseType"] => string(4) "json"
        }
      }
      The error ist reproducable in test and prod environment with different versions (4.1.4 in prod and 4.1.5 in test).

      Cheers
    Issue Details
    Issue Number 6304
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Admin Panel
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 4.1.5
    Fixed Version 4.1.6
    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. July 28, 2022 11:40 AM
      pegasus pegasus is offline
      VaultWiki Team
      Took a while to find this as it is not designed to have a 0 value in this field. However, I found a bug in the upgrade process from VaultWiki on XenForo 1.x to VaultWiki on XenForo 2.x that can cause some records to have this field zero-filled.

      I believe that XenForo has a bug here as well, since XenForo's XF:ModeratorContent entity accepts and saves a 0 value for content_id without throwing an error, even though its _postDelete and possibly other uses expect there to be a non-zero value.

      For the next release we have tightened things up to reduce the likelihood of a 0 being passed when creating new wiki moderators. However, in order to delete your existing moderators you will need to edit src/addons/vw/vw/XF/Entity/ModeratorContent.php. Find:
      Code:
      if ($this->content_type == 'vwarea' AND !$this->vwSkipWikiMod)
      BEFORE it, add:
      Code:
      		if ($this->content_type == 'vwarea' AND !$this->content_id)
      		{
      			$index = \vw_Hard_Core::controller('Fetch')->cached('Index', 0);
      			$this->content_id = $index['pageid'];
      		}
      After making this change, it should allow you to delete the moderator.
      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:34 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.