• 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
    • Error Deleting Areas

    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: Error Deleting Areas

    • Issue Tools
      • View Changes
    1. issueid=4310 May 28, 2015 7:46 AM
      Gossamer Gossamer is offline
      Junior Member
      Error Deleting Areas

      When I try to delete an area, I get this error:
      Code:
      Server Error
      
      Database Error: SELECT pageid,pagecount FROM `vw_counter` WHERE `pageid` IN (15) Mysqli prepare error: Unknown column 'pageid' in 'field list'
      
      vw_DB_Controller_XF->throw_error() in /home/pandorar/public_html/markedrp.com/vault/core/controller/db/xf.php at line 160
      vw_DB_Controller_XF->query_read() in /home/pandorar/public_html/markedrp.com/vault/core/model/db/mysql/vw.php at line 29
      vw_DB_MySQL_Model->select() in /home/pandorar/public_html/markedrp.com/vault/core/controller/cp/area/vw.php at line 564
      vw_CP_Area_Controller->affected_counts() in /home/pandorar/public_html/markedrp.com/vault/core/controller/cp/area/vw.php at line 536
      vw_CP_Area_Controller->delete() in /home/pandorar/public_html/markedrp.com/vault/core/controller/cp/area/vw.php at line 62
      vw_CP_Area_Controller->execute() in vw/XenForo/ControllerAdmin/Wiki.php at line 113
      vw_XenForo_ControllerAdmin_Wiki->actionIndex() in XenForo/FrontController.php at line 347
      XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
      XenForo_FrontController->run() in /home/pandorar/public_html/markedrp.com/admin.php at line 13
    Issue Details
    Issue Number 4310
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Admin Panel
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.0.4
    Fixed Version 4.0.4
    Milestone (none)
    Software DependencyXenForo 1.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. May 28, 2015 8:22 AM
      pegasus pegasus is offline
      VaultWiki Team
      In vault/core/controller/cp/area/vw.php, find:
      Code:
      		$affected = vw_DB::get()->query()->select(array(
      			'fields' => array(
      				'pageid',
      				'pagecount'
      			),
      			'table' => 'vw_counter',
      			'where' => vw_DB::get()->query()->in('pageid', $this->data['area']['area_childlist']),
      		));
      
      		while ($effect = vw_DB::get()->func()->fetch_array($affected))
      		{
      			$this->data['areas'][$effect['pageid']] = $effect['pageid'];
      			$this->data['page_count'] += $effect['pagecount'];
      		}
      Replace with:
      Code:
      		$prep = vw_DB::get()->query()->prepare(array(
      			'r' => array(
      				'table' => 'vw_route',
      				'alias' => 'r',
      				'fields' => array(
      					'routeid' => '',
      					'itemtypeid' => '',
      					'itemid' => ''
      				)
      			),
      			'c' => array(
      				'table' => 'vw_counter',
      				'alias' => 'c',
      				'fields' => array(
      					'routeid' => '',
      					'*' => ''
      				)
      			)
      		));
      
      		$childlist = $this->data['area']['area_childlist'];
      		$types = vw_Hard_Core::model('Node')->all('isContent');
      
      		if (!is_array($childlist))
      		{
      			$childlist = explode(',', $this->data['area']['area_childlist']);
      		}
      
      		$affected = vw_DB::get()->query()->select(array(
      			'fields' => array($prep['c']['fields']['*']),
      			'table' => array('vw_route' => 'r'),
      			'joins' => array(
      				array(
      					'table' => array('vw_counter' => 'c'),
      					'where' => vw_DB::get()->query()->eq($prep['r']['fields']['routeid'], $prep['c']['fields']['routeid'])
      				)
      			),
      			'where' => array(
      				vw_DB::get()->query()->eq($prep['r']['fields']['itemtypeid'], vw_Hard_Core::model('Node')->id('Page')),
      				vw_DB::get()->query()->in($prep['r']['fields']['itemid'], $childlist)
      			),
      			'limit' => count($childlist)
      		));
      
      		while ($effect = vw_DB::get()->func()->fetch_array($affected))
      		{
      			$this->data['areas'][$effect['pageid']] = $effect['pageid'];
      
      			foreach ($types AS $type)
      			{
      				if (!isset($effect[$type['table'] . 'count']))
      				{
      					continue;
      				}
      
      				$this->data['page_count'] += $effect[$type['table'] . 'count'];
      			}
      		}
      Reply Reply
    2. May 28, 2015 5:49 PM
      Gossamer Gossamer is offline
      Junior Member
      Thanks! It's working now.
      Reply Reply
    3. May 28, 2015 6:10 PM
      Gossamer Gossamer is offline
      Junior Member
      Oh, wait, not entirely working. If I delete a parent area, thus deleting the sub areas inside of it, those sub areas are not entirely removed from the database.

      At the very least, they remain in the vw_routes table, and thus I can't recreate the areas without receiving a "The current Prefix and Title combination matches another item" error.
      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 10:38 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.