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:
#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());