• 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
    • Pages not imported into categories

    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: Pages not imported into categories

    • Issue Tools
      • View Changes
    1. issueid=4929 February 24, 2017 5:11 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Pages not imported into categories

      I did a VW3 to VW4 import and after checking I found that various categories have no pages anymore, whie there were many pages in those categories.
    Issue Details
    Issue Number 4929
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Importing
    Status Fixed
    Priority 1 - Security / Login / Data Loss
    Affected Version 4.0.16
    Fixed Version 4.0.17
    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. February 24, 2017 5:30 PM
      pegasus pegasus is offline
      VaultWiki Team
      The last time you had an issue with this was: https://www.vaultwiki.org/issues/4605/
      In newer releases, it should no longer be necessary to manually set CATEGORY to CAT in XenForo. I'm not aware of any changes to 4.0.16 since your successful test import that would have affected this or category importing in general.

      Make sure you have permission to view the contents of categories (Category Permissions > Can view list of contents for Categories?). That throws me off from time to time.
      Reply Reply  
    2. February 24, 2017 6:19 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      All permissions are set to yes. I will open a ticket for you to check.
      Reply Reply  
    3. February 26, 2017 11:49 AM
      pegasus pegasus is offline
      VaultWiki Team
      I was able to successfully import categories on your site. Please see your Special:Categories page to review.

      There were a couple of problems that had prevented it from working properly before:
      1. Imported prefixes were not able to create any new prefix-BB-Codes in the target wiki.
      2. Imported prefixes were not able to connect to existing namespace-function BB-Codes, if the BB-Code in the target wiki had not been renamed to match the source BB-Code before importing (CAT vs CATEGORY). If the BB-Code in the target wiki had been renamed before importing, then there was no problem.
      3. Plural support is known to be broken in the current version (e.g. mapping Category:Thing and Category:Things to the same category). Currently, if "Things" exists, then "Category:Thing" is incorrectly mapped to it.
      4. If a category didn't exist as a page yet when importing the category membership, if the same category was used by, say, 3 pages in the same batch, then the category would be created 3 times, with only 1 member each (each of the 3 pages respectively). If the same category was used by different pages in different batches, then there was no problem.

      It is strange to me that these issues did not show up on previous test imports.

      #1
      In vault/core/controller/dm/prefix/vw.php, find:
      Code:
      		if (
      			!$this->instance->get('languageid') AND
      			!$this->instance->get('parentid') AND
      			$this->instance->get_info('bbcode_tag_change')
      		)
      Replace with:
      Code:
      		if (
      			!$this->instance->get('languageid') AND
      			!$this->instance->get('parentid') AND
      			(
      				!$this->instance->get_existing('prefixid') OR
      				$this->instance->get_info('bbcode_tag_change')
      			)
      		)
      #2
      In vault/core/controller/import/handle/vw3/area/vw.php, find:
      Code:
      $tag_function = array_search($namespace['forumid'], $this->settings);
      Replace with:
      Code:
      $tag_function = array_search($namespace['namespaceid'], $this->settings);
      #3
      Fixing plural support is somewhat complicated. Probably easier to disable it during the import and manually move the category contents from one to another if you have singular and plural versions of the same category.

      In vault/core/model/parser/handle/vw.php, find:
      Code:
      	public function do_bbcode_plurals(&$output, $option)
      	{
      After it, add:
      Code:
      return '';
      #4
      I don't think you really have an issue with the last problem; I think I only saw it because the first two issues were happening. But with plural support disabled you might need it.

      In vault/core/controller/route/vw.php, find:
      Code:
      public function get_page_list($prefixkey = '')
      Before it, add:
      Code:
      	public function set_page_list_entry($item)
      	{
      		if (!isset($this->page_list[$item['parentprefixid']]))
      		{
      			// the entry will be set anyway if this is fetched
      			return;
      		}
      
      		$tmp = array();
      
      		$tmp[self::ROUTE_URL] = $item['url'];
      		$tmp[self::ROUTE_ID] = $item['itemid'];
      		$tmp[self::ROUTE_TYPEID] = $item['itemtypeid'];
      		$tmp[self::ROUTE_STACK] = $item['stackids'];
      
      		if (isset($item['keylength']))
      		{
      			$tmp[self::ROUTE_LENGTH] = $item['keylength'];
      			$tmp[self::ROUTE_WORD] = $item['maxword'];
      		}
      		else
      		{
      			$tmp[self::ROUTE_LENGTH] = 0;
      			$tmp[self::ROUTE_WORD] = 0;
      		}
      
      		$tmp[self::ROUTE_ROUTEID] = $item['routeid'];
      
      		if (!empty($item['searchmeta']) AND preg_match_all('# type_(\d+)#', $item['searchmeta'], $matches))
      		{
      			foreach ($matches[1] AS $metatypeid)
      			{
      				$type = vw_Hard_Core::model('Node')->one($metatypeid);
      
      				if ($type AND !empty($type['route_needs_meta']))
      				{
      					$tmp[self::ROUTE_META] = $item['searchmeta'];
      					break;
      				}
      			}
      		}
      
      		if ($tmp[self::ROUTE_LENGTH] > $this->reverse_max[$item['parentprefixid']]['key'])
      		{
      			$this->reverse_max[$item['parentprefixid']]['key'] = $tmp[self::ROUTE_LENGTH];
      		}
      
      		if ($tmp[self::ROUTE_WORD] > $this->reverse_max[$item['parentprefixid']]['word'])
      		{
      			$this->reverse_max[$item['parentprefixid']]['word'] = $tmp[self::ROUTE_WORD];
      		}
      
      		$json_options = 0;
      
      		if (defined('JSON_UNESCAPED_UNICODE'))
      		{
      			$json_options |= JSON_UNESCAPED_UNICODE;
      		}
      
      		if (!empty($item['titlekey']) AND $item['titlekey'] != $item['itemkey'])
      		{
      			// keep the unencoded title as a reference to save memory,
      			// but allow reverse lookups where lossy encoding doesn't return expected results
      
      			$tmp2 = $tmp + array(self::ROUTE_CANON => $item['itemkey']);
      			$this->page_list[$item['parentprefixid']][$item['titlekey']] = json_encode($tmp2, $json_options);
      		}
      
      		$this->page_list[$item['parentprefixid']][$item['itemkey']] = json_encode($tmp, $json_options);
      	}
      In vault/core/controller/dm/route/vw.php, find:
      Code:
      	public function post_save_each($doquery = true)
      	{
      After it, add:
      Code:
      vw_Hard_Core::controller('Route')->set_page_list_entry($this->instance->get());
      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 8:26 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.