• 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 3.x Series
    • Bug
    • forumread sql error

    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: forumread sql error

    • Issue Tools
      • View Changes
    1. issueid=872 October 9, 2009 4:34 PM
      Helmut71 Helmut71 is offline
      Junior Member
      forumread sql error

      Today I got several sql errors..concerning the ces wiki, f.e.:

      Code:
      Invalid SQL:
      
      SELECT forumid, readtime
      FROM forumread
      WHERE userid = 49
      AND forumid IN (62,61,61,63,,64,64,-1);
      
      MySQL-Fehler  : Fehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagen bei '64,64,-1)' in Zeile 4
      Fehler-Nr.    : 1064
      Fehler-Zeit   : Friday, 09.10.2009 @ 21:47:15
      Datum         : Friday, 09.10.2009 @ 21:47:15
      Skript        : http://www.weinviertel.net/forumdisplay.php?f=61&redirect=no
      Referrer      : 
      IP-Adresse    : 195.69.193.12
      Benutzername  : Wolfgang B
      Klassenname   : vB_Database
      where do the come from??
    Issue Details
    Issue Number 872
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Forum Display
    Status Fixed
    Priority 4 - Warnings / Script Errors
    Affected Version 2.5.4
    Fixed Version 2.5.5
    Milestone (none)
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. October 9, 2009 6:50 PM
      pegasus pegasus is offline
      VaultWiki Team
      It's pretty hard to debug an error like this since you can't consistently reproduce it, but you can try editing vault/special_plugins_forumdisplay.php, find:
      Code:
      				$space['forumid'] = $vault->misc['specialforum'];
      Add above:
      Code:
      				if (!$vault->misc['specialforum'])
      				{
      					continue;
      				}
      I believe this occurs when the user doesn't have permission to view Special:Specialpages, and they visit the forum it appears in.
      Reply Reply  
    2. October 11, 2009 1:09 PM
      Helmut71 Helmut71 is offline
      Junior Member
      Code:
      $space['forumid'] = $vault->misc['specialforum'];
      thisappears two times in special_plugins_forumdisplay.

      I believe you though of adding it after the second.

      If I do so, the sql error doesn't appear anymore.

      But - evreyone now can view the wiki-sites, no matter if he has the rights for it.

      btw: you were right. This error appears when a user tries to see the wiki-pages and the rights in the usergroup isn't set..
      Reply Reply  
    3. October 11, 2009 1:29 PM
      Helmut71 Helmut71 is offline
      Junior Member
      hmm - is this really "fiexed"??

      If I do as told above, the usergrou permissions don't work anymore..
      Reply Reply  
    4. October 11, 2009 1:48 PM
      pegasus pegasus is offline
      VaultWiki Team
      Yes, this is really fixed, as the function is actually much different in the next build. The above edit was simply to fix the db error without "upgrading" your file. You can use the updated function by replacing the entire function special_cache_ordered_forums with:
      Code:
      function special_cache_ordered_forums()
      {
      	global $vault;
      
      	$space = $vault->namespacecache[SPECIAL_SPACE];
      	$vault->misc['orderforums'] = true;
      
      	if (
      		!$space['forumid'] OR
      		!$vault->permissions['view']['all'] OR
      		!$vault->permissions['view']['specialpages']
      	)
      	{
      		return;
      	}
      
      	global $vbulletin, $foruminfo;
      
      	if (empty($vault->special['pages']))
      	{
      		require_once(DIR . '/vault/special_class_special.php');
      		$special = new vB_SpecialFactory($vbulletin);
      	}
      
      	$special = array(
      		'title' => $GLOBALS['vbphrase']['specialpages_title'],
      		'namespaceid' => SPECIAL_SPACE
      	);
      
      	$vault->urlgenerate($special);
      	$vault->misc['specialforum'] = 0;
      
      	for ($i = 65535; $i > -1; $i--)
      	{
      		if (empty($vbulletin->forumcache["$i"]))
      		{
      			$vault->misc['specialforum'] = $i;
      			break;
      		}
      	}
      
      	$spaceid = $space['forumid'];
      	$space['forumid'] = $vault->misc['specialforum'];
      
      	if (!$space['forumid'])
      	{
      		// there were no available forums, wtf
      		return;
      	}
      
      	$vbulletin->forumcache[$space['forumid']] = array(
      		'forumid' => $space['forumid'],
      		'title' => $space['title'],
      		'displayorder' => $space['displayorder'],
      		'childlist' => $space['forumid'] . ',-1',
      		'parentlist' => $space['forumid'] . ",$spaceid,-1",
      		'parentid' => $spaceid,
      		'options' => $vbulletin->bf_misc_forumoptions['active'],
      		'link' => $special['url'],
      		'vault_type' => 1,
      		'threadcount' => count($vault->special['pages']),
      		'replycount' => count($vault->special['pages']),
      		'permissions' => $vbulletin->forumcache["$spaceid"]['permissions']
      	);
      
      	foreach (explode(',', $vbulletin->forumcache["$spaceid"]['parentlist']) AS $parent)
      	{
      		if ($parent == -1)
      		{
      			continue;
      		}
      
      		$vbulletin->forumcache["$parent"]['childlist'] = str_replace(',' . $spaceid . ',', ',' . $spaceid . ',' . $space['forumid'] . ',', $vbulletin->forumcache["$parent"]['childlist']);
      	}
      
      	foreach (explode(',', $vbulletin->forumcache["$spaceid"]['childlist']) AS $child)
      	{
      		if (
      			$child == -1 OR
      			$child == $spaceid OR
      			$vbulletin->forumcache["$child"]['displayorder'] < $space['displayorder']
      		)
      		{
      			continue;
      		}
      
      		// this should reorder later entries after wikis
      		$pop = $vbulletin->forumcache["$child"];
      		unset($GLOBALS['vbulletin']->forumcache["$child"]);
      		$GLOBALS['vbulletin']->forumcache["$child"] = $pop;
      	}
      
      	// make the browsers correct
      	if ($foruminfo['forumid'] AND $foruminfo['forumid'] == $spaceid)
      	{
      		$foruminfo['childlist'] = $vbulletin->forumcache["$spaceid"]['childlist'];
      	}
      
      	if (!$vbulletin->options['showprivateforums'])
      	{
      		// permissions don't really exist, inherit
      		$vbulletin->userinfo['forumpermissions'][$space['forumid']] = $vbulletin->bf_ugp_forumpermissions['canview'];
      	}
      }
      Reply Reply  
    5. October 11, 2009 2:11 PM
      Helmut71 Helmut71 is offline
      Junior Member
      thanks for the quick reply.

      I
      Reply Reply  
    6. October 11, 2009 3:57 PM
      pegasus pegasus is offline
      VaultWiki Team
      The only thing I see at that page is a thread list with article "Testtitel". Not seeing the forumbit for special.
      Reply Reply  
    7. October 12, 2009 4:22 AM
      Helmut71 Helmut71 is offline
      Junior Member
      Quote Originally Posted by pegasus
      The only thing I see at that page is a thread list with article "Testtitel". Not seeing the forumbit for special.
      Hmm..me too! I can't see "special-wiki" too, even as an admin and with all group rights.
      Reply Reply  
    8. October 12, 2009 1:14 PM
      pegasus pegasus is offline
      VaultWiki Team
      This is working correctly on my test install. If it's a significant problem for you, you can send me a PM and I can have a look at your forum's settings.
      Reply Reply  
    9. October 15, 2009 10:00 AM
      Helmut71 Helmut71 is offline
      Junior Member
      Thanks a lot - I will try it one more time and maybe ask you afterwards if this is ok..

      Perhaos you could prvide the updated special_cache_ordered_forums.php?
      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 12:10 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 © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.