• 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
    • Empty articles in Namespace with Spaces in Title

    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: Empty articles in Namespace with Spaces in Title

    • Issue Tools
      • View Changes
    1. issueid=784 August 15, 2009 10:58 PM
      tommythejoat tommythejoat is offline
      Regular Member
      Empty articles in Namespace with Spaces in Title
      Our hidden sandbox articles are now displayed in main namespace

      I mentioned this in another bug report and you said it was because not all the references had display order 0 for our Sandbbox.

      I deleted the category that I was using as a redirect to the Sandbox and replaced it with a url in the text of the Header Article for the Encyclopedia namespace. Both the namespace Sandbox and the Forum Sandbox now have display order 0. Forum Sanbox has no one as its parent.

      Older articles are listed only in Sandbox. Articles posted since the 2.5 update show up in the article list for Encyclopedia.

      When I created a new article in this namespace after the edits, I got a very strange editor window with no title field and the article ended up with the title "Play area:Special:search."

      It seems clear that something is broken. It may be unique to our site, but it is interfering with development as we work on tutorial articles.
    Issue Details
    Issue Number 784
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Namespaces
    Status Fixed
    Priority 5 - Minor Bugs / Small Tweaks
    Affected Version 2.5.0
    Fixed Version 2.5.1
    Milestone VaultWiki 3.0.0
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. August 18, 2009 2:26 AM
      pegasus pegasus is offline
      VaultWiki Team
      Someone else had this problem and I was able to come up with what seems to be a working fix for the "+" namespaces:
      In vault/special_class_wiki.php, replace the ENTIRE function fetch_namespace_array() with:
      Code:
      	function fetch_namespace_array($lower = false)
      	{
      		if ($lower)
      		{
      			if (!empty($this->namespaces_lower))
      			{
      				return;
      			}
      
      			global $vbulletin;
      
      			if (empty($this->namespaces))
      			{
      				$this->fetch_namespace_array();
      			}
      
      			foreach ($this->namespaces AS $id => $text)
      			{
      				$temp = strtolower($this->urlencode($text, $id));
      
      				if ($vbulletin->options['vault_spaces'] == 0)
      				{
      					$temp = str_replace('+', ' ', $temp);
      				}
      
      				$this->namespaces_lower["$id"] = $temp;
      			}
      
      			return;
      		}
      
      		global $vbulletin;
      
      		if (!empty($this->namespaces))
      		{
      			return;
      		}
      
      		$this->namespaces = array();
      
      		if (!empty($vbulletin->options['vault_namespaces']))
      		{
      			$this->namespacecache = unserialize($vbulletin->options['vault_namespaces']);
      		}
      
      		if (!is_array($this->namespacecache))
      		{
      			$this->namespacecache = array();
      			return;
      		}
      
      		foreach ($this->namespacecache AS $namespaceid => $namespace_info)
      		{
      			if (
      				empty($namespace_info['forumid']) AND
      				$namespaceid != ISLAND_SPACE AND
      				$namespaceid != SPECIAL_SPACE
      			)
      			{
      				continue;
      			}
      			/*
      			* 0 => island,
      			* 1 => special,
      			* 2 => template,
      			* 3 => help,
      			* 4 => header,
      			* 5 => book,
      			* 6 => default
      			*/
      			// tags are for markup and should be ignored
      			$this->namespaces["$namespaceid"] = strip_tags($namespace_info['title']);
      		}
      	}
      In vault/special_plugins.php, replace the ENTIRE function special_verify_id() with:
      Code:
      function special_verify_id($idname, &$fallbackid, $alert = true, $selall = false, $options = 0)
      {
      	global $vbulletin, $vault;
      
      	$type = 'wiki';
      
      	// $_REQUEST vars are already decoded!!!
      	$id = $vbulletin->GPC[$vbulletin->options['ces_titlevar']];
      
      	if (stripos($id, 'island:') === 0)
      	{
      		$fallbackid = substr($id, 7);
      		$id = '';
      	}
      
      	if (empty($id) AND intval($fallbackid))
      	{
      		$type = 'island';
      		$id = $fallbackid;
      	}
      
      	if (empty($id))
      	{
      		if ($alert)
      		{
      			global $globaltemplates, $show;
      
      			$vault->error += VAULT_NOID;
      			$id = $vault->namespacecache[SPECIAL_SPACE]['title'] . ':' . $GLOBALS['vbphrase']['search_title'];
      			$vault->misc['special'] = 'search';
      			$type = 'wiki';
      			$globaltemplates[] = 'vault_search_noid';
      		}
      		else
      		{
      			return array($idname . 'id' => 0);
      		}
      	}
      
      	if ($type == 'island')
      	{
      		$fetchid = $id;
      		$titlecache = '';
      	}
      
      	$selid = ($selall ? '*' : $idname . 'id');
      
      	if ($type != 'island')
      	{
      		if (
      			$_SERVER['REQUEST_METHOD'] == 'POST' AND
      			(
      				$_POST['do'] == 'create' OR
      				$_POST['do'] == 'edit'
      			) AND
      			empty($_POST['edittitle']) AND
      			!$vbulletin->GPC['ajax']
      		)
      		{
      			$test = array(
      				'title' => $id,
      				'forumid' => $vbulletin->GPC['forumid'],
      				'prefixid' => $_POST['prefixid']
      			);
      
      			$vault->affix_prefix($test);
      			$id = $test['title'];
      		}
      
      		$titlecache = strtolower($id);
      		$titlebits = explode(':', $titlecache, 2);
      
      		if ($vbulletin->GPC['forumid'] > 0)
      		{
      			$islandforum = fetch_foruminfo($vbulletin->GPC['forumid']);
      
      			if ($islandforum['vault_type'] == 2)
      			{
      				$hook_namespace = 0;
      			}
      			else
      			{
      				$hook_namespace = $vault->fetch_namespaceid($vbulletin->GPC['forumid']);
      			}
      		}
      
      		$vault->fetch_namespace_array(true);
      
      		if (
      			in_array($titlebits[0], $vault->namespaces_lower) AND
      			$titlebits[0] != $titlecache
      		)
      		{
      			$titlecache = $titlebits[1];
      
      			$new_hook_namespace = array_search($titlebits[0], $vault->namespaces_lower);
      			$forumcache = $titlebits[0];
      
      			if (isset($hook_namespace) AND $new_hook_namespace != $hook_namespace)
      			{
      				// we actually want the namespace in the title in another namespace
      				$there_was_no_namespace = true;
      				$forumcache = $vault->namespaces["$new_hook_namespace"];
      				$titlecache = implode(':', $titlebits);
      			}
      			else
      			{
      				$there_was_no_namespace = false;
      			}
      
      			$hook_namespace = $new_hook_namespace;
      		}
      		else
      		{
      			if ($islandforum['vault_type'] != 2)
      			{
      				if (!$hook_namespace OR empty($vault->namespaces["$hook_namespace"]))
      				{
      					$hook_namespace = intval($vbulletin->options['ces_default_forumid']);
      				}
      
      				$forumcache = $vault->namespaces["$hook_namespace"];
      			}
      
      			$titlecache = implode(':', $titlebits);
      			$there_was_no_namespace = true;
      		}
      
      		if ($hook_namespace)
      		{
      			$fetchid = $vault->fetch_article($titlecache, $hook_namespace, VAULT_LANGUAGEID, 'threadid');
      		}
      		else
      		{
      			$fetchid = false;
      		}
      	}
      
      	($hook = vBulletinHook::fetch_hook('vault_verify_id')) ? eval($hook) : false;
      
      	if (($islandforum['vault_type'] == 2 OR $fetchid) AND empty($check))
      	{
      		if ($selid == '*')
      		{
      			$vault->misc['fetchid'] = $fetchid ? $fetchid : $titlecache;
      			$vault->misc['hook_namespace'] = intval($hook_namespace);
      			$vault->misc['fetch_lastpostinfo'] = true;
      
      			if ($idname == 'post')
      			{
      				global $threadinfo, $postcache;
      
      				$threadinfo = fetch_threadinfo($fetchid, false);
      				$postcache[$threadinfo['firstpostid']] = NULL;
      				$check = fetch_postinfo($threadinfo['firstpostid']);
      			}
      			else if ($idname == 'thread')
      			{
      				$check = fetch_threadinfo($fetchid, false);
      			}
      		}
      		else
      		{
      			$check = $vbulletin->db->query_first("
      				SELECT $idname.$selid, IF(forum.vault_type = 2, 1, 0) AS island
      				FROM " . TABLE_PREFIX . "$idname AS $idname" . ($idname == 'post' ? "
      				LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)" : "") . "
      				LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (thread.forumid = forum.forumid)
      				WHERE $idname.threadid = " . intval($fetchid) . "
      				ORDER BY $idname.dateline ASC
      			");
      		}
      	}
      
      	if (empty($check) AND $alert)
      	{
      		if ($type == 'island')
      		{
      			global $vbphrase;
      
      			$vault->error += VAULT_ISLAND_ERROR;
      			$vault->errno = $idname;
      		}
      
      		if (!$fetchid AND $idname == 'post')
      		{
      			global $threadinfo;
      		}
      
      		if ($idname == 'post')
      		{
      			$threadinfo['threadid'] = 'error';
      		}
      		else
      		{	
      			$check['threadid'] = 'error';
      		}
      
      		if (
      			// this was direct request
      			$_SERVER['REQUEST_METHOD'] == 'GET' OR
      			(
      				// all we did was switch tabs
      				$_REQUEST['do'] == 'edit' AND
      				empty($_POST['forumid'])
      			)
      		)
      		{
      			// make best guess at intended title
      			$id = $vault->urldecode($id);
      		}
      
      		if ($there_was_no_namespace)
      		{
      			if ($idname == 'post')
      			{
      				$threadinfo['title'] = $id;
      			}
      			else
      			{
      				$check['title'] = $id;
      			}
      		}
      		else
      		{
      			if ($idname == 'post')
      			{
      				$threadinfo['title'] = substr($id, strpos($id, ':') + 1);
      			}
      			else
      			{
      				$check['title'] = substr($id, strpos($id, ':') + 1);
      			}
      		}
      
      		if ($idname == 'post')
      		{
      			// the db title would have been html encoded
      			$threadinfo['title'] = htmlspecialchars_uni($threadinfo['title']);
      			$threadinfo['namespaceid'] = $hook_namespace;
      			$threadinfo['firstpostid'] = -1;
      
      			if ($islandforum['vault_type'] == 2)
      			{
      				$threadinfo['forumid'] = $vbulletin->GPC['forumid'];
      			}
      			else if ($hook_namespace != SPECIAL_SPACE)
      			{
      				$threadinfo['forumid'] = $vault->namespacecache["$hook_namespace"]['forumid'];
      			}
      		}
      		else
      		{
      			// the db title would have been html encoded
      			$check['title'] = htmlspecialchars_uni($check['title']);
      			$check['namespaceid'] = $hook_namespace;
      			$check['firstpostid'] = -1;
      
      			if ($islandforum['vault_type'] == 2)
      			{
      				$check['forumid'] = $vbulletin->GPC['forumid'];
      			}
      			else if ($hook_namespace != SPECIAL_SPACE)
      			{
      				$check['forumid'] = $vault->namespacecache["$hook_namespace"]['forumid'];
      			}
      		}
      
      		if ($hook_namespace > SPECIAL_SPACE AND $vbulletin->forumcache[($idname == 'post' ? $threadinfo['forumid'] : $check['forumid'])]['vault_type'] != 1)
      		{
      			$vault->error += VAULT_TOP_LEVEL;
      		}
      	}
      	unset($there_was_no_namespace, $hook_namespace, $fetchid, $type);
      
      	return ($selall ? $check : $check["$selid"]);
      }
      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:05 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.