• 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
    • Script to rebuild namespaces by a cron job

    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: Script to rebuild namespaces by a cron job

    • Issue Tools
      • View Changes
    1. issueid=2452 September 12, 2011 5:09 AM
      markber markber is offline
      New Member
      Script to rebuild namespaces by a cron job
      Could you please create a script to rebuild namespaces by a cron job?

      Hello,

      Could you please create a script to rebuild namespaces by a cron job?

      It looks like the issue with empty articles from RSS import (see at https://www.vaultwiki.org/issues/2224 ) can be somewhat addressed by using VaultWiki Lite and rebuilding namespaces after RSS import. This trick does not work with VaultWiki Premium though.

      Thank you,

      Mark
    Issue Details
    Issue Number 2452
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category RSS Feeds
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 3.0.14
    Fixed Version 3.0.15
    Milestone (none)
    Software DependencyvBulletin 3.6
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. September 12, 2011 12:02 PM
      pegasus pegasus is offline
      VaultWiki Team
      Instead it's better to fix the RSS bug. The problem is that the newly created thread is not stored in $threadinfo after it's created via RSS.

      In vault/plugins/newpost.php, find:
      Code:
      		global $threadinfo, $vault;
      Add after:
      Code:
      		if (!$threadinfo)
      		{
      			$threadinfo = fetch_threadinfo($post['threadid']);
      		}
      In order to fix old articles, you would have to move them to a non-wiki forum using inline moderation. Then move them back and they will be visible again. Although rebuilding namespaces works for most "missing" articles, this only works because the article's URL is broken. It doesn't work for RSS because the article was never created in the first place.
      Reply Reply  
    2. September 13, 2011 4:42 AM
      markber markber is offline
      New Member
      Thank you for your reply, pegasus!

      However, the fix does not work because the function special_newpost_complete() apparently does not get called at all when a new RSS post gets created. Has the fix worked in your hands?

      Please advise.

      Thank you,

      Mark
      Reply Reply  
    3. September 13, 2011 7:15 AM
      markber markber is offline
      New Member
      Hi pegasus,

      It looks like the code that you mentioned could never work because

      1) In VaultWiki plugin "Thread Data - ReCache Edited First Post", condition
      Code:
      $this->forum['vault_type']
      is never satisfied (i.e. never "> 0" )

      and

      2) In function special_newpost_complete() in newpost.php,
      Code:
      $post['postid']
      is not numerical.

      I confirmed the problems with both paid and free (plugin and PHP filenames are obviously different for the free one) versions of VaultWiki and with vBulletin versions 3.7.4 and 4.1.5.

      You may want to double-check if the programmers that VaultWiki hires actually test the code before releasing it, not just assume that it would work.

      I would also appreciate if you could figure out an intelligent fix for these problems (other than commenting out $post['postid'] and $this->forum['vault_type']).

      Thank you,
      Mark
      Reply Reply  
    4. September 14, 2011 2:28 AM
      pegasus pegasus is offline
      VaultWiki Team
      Hi,

      Replace the code in the plugin you mentioned with this:
      Code:
      if (THIS_SCRIPT != 'threadrate' AND $this->post['postid'] = $this->fetch_field('firstpostid'))
      {
      	global $vault;
      
      	$vault->fetch_instance('contenttype');
      
      	if ($this->info['vault_options'])
      	{
      		$this->dbobject->query_write("
      			REPLACE INTO " . TABLE_PREFIX . "vault_options
      				(contenttypeid, contentid, options)
      			VALUES
      				(" . intval($vault->misc['contenttypes']['post']) . ", " . intval($this->post['postid']) . ", " . intval($this->info['vault_options']) . ")
      		");
      	}
      	else
      	{
      		$this->dbobject->query_write("
      			DELETE FROM " . TABLE_PREFIX . "vault_options
      			WHERE contenttypeid = " . intval($vault->misc['contenttypes']['post']) . "
      				AND contentid = " . intval($this->post['postid']) . "
      		");
      	}
      
      	if ($this->registry->options['vault_caching'] OR $this->info['forum']['vault_type'])
      	{
      		require_once(DIR . '/vault/plugins/data.php');
      		special_data_postsave($this);
      	}
      
      	if (
      		$this->info['is_automated'] == 'rss' AND
      		$this->info['forum']['vault_type'] AND
      		$this->condition === null
      	)
      	{
      		require_once(DIR . '/vault/plugins/newpost.php');
      		$post = array_merge($this->post, $this->thread);
      		special_newpost_complete($post, 'thread');
      	}
      }
      Re: your comments in #2. This is not released code. I don't guarantee that this will work. It will not be tested or released until the next actual release of VaultWiki. Also we haven't -officially- included RSS support yet, which is why the code wasn't finished, and it is not planned until at least 4.0.0 Beta 2.
      Reply Reply  
    5. September 15, 2011 10:24 PM
      markber markber is offline
      New Member
      Thanks a lot, pegasus!

      After all plugin and code modifications, RSS import works just fine now.

      Mark
      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 11:45 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.