• 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
    • Really need some help on this one: missing redirects

    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: Really need some help on this one: missing redirects

    • Issue Tools
      • View Changes
    1. issueid=2521 November 3, 2011 9:29 PM
      Lord Doys Lord Doys is offline
      Junior Member
      Really need some help on this one: missing redirects

      I started this week with creating missing redirects that were NOT converted.
      It turns out they are ALL redirects in MAIN that link to pages in another NameSpace (worth looking into)

      i just ran a query on the old wiki install DB
      PHP Code:
      select page.page_id, page.page_title, page.page_is_redirect, redirect.rd_namespace, redirect.rd_title 
      from wiki_page 
      as page
      LEFT JOIN wiki_redirect 
      as redirect ON ( page.page_id = redirect.rd_from)
      WHERE redirect.rd_namespace = '110' 
      And it turns out i SHOULD have 3869 redirects, going from main to namespace 110

      when running a query to see how many actually ARE in the wiki..
      PHP Code:
      Select title, pagetext from vb3_post where pagetext LIKE '[REDIRECT]D20%' 
      and
      PHP Code:
      Select title, pagetext from vb3_post where pagetext LIKE '[REDIRECT][srd%' 
      the [REDIRECT]D20:xxxxxxxx pages are a total of 93 (this are links to pagetitles)
      and the [REDIRECT][srd]xxxxxxxxxx are a total of 253 (these are link to properly build links of namespace SRD)

      so doing a quick math: 3869 - (93 + 253) = TOO MANY

      what i want to do is to have a php script (or a mysql query if that is enough) where the remaining redirects are insterted in the right places in the DB.

      for me this is a lot to puzzle who what and where, probably for you not.

      or point me in the right direction, which tables/fields have to be updated to insert a redirect.
    Issue Details
    Issue Number 2521
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Importing
    Status Fixed
    Priority 1 - Security / Login / Data Loss
    Affected Version 3.0.14
    Fixed Version 3.0.15
    Milestone (none)
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. November 4, 2011 3:30 AM
      pegasus pegasus is offline
      VaultWiki Team
      If this is true, it looks like redirects are stored differently nowadays in MediaWiki than they were before... I will have to update the importer and get back to you, because I'm not sure yet how the data is stored exactly.
      Reply Reply  
    2. November 4, 2011 4:47 AM
      Lord Doys Lord Doys is offline
      Junior Member
      Thanks,

      I am .. well was, using version 1.16.0, which isnt the latest version of mediawiki.

      If you want i can upload a DB dump of my mediawiki install for testing purposes.
      Reply Reply  
    3. November 5, 2011 4:10 AM
      pegasus pegasus is offline
      VaultWiki Team
      There may be some miscommunication going on which has made this difficult to check out each time you've mentioned it. When you say "the redirects weren't converted", this leads me to believe that the redirect was imported, but it still uses MediaWiki syntax that VaultWiki doesn't recognize - they simply don't work and show as plain text. Is this correct, or were the redirects never imported at all?

      I have looked at the code for MediaWiki 1.17.0, and there should not be a problem importing redirects, as all the old information is still there (redirects are still stored as pages). According to what I see in the source code, the redirect table is unreliable and is used internally like a cache. If redirects were not imported at all, maybe the pending redirect imports are determined invalid based on other criteria and skipped.

      In this case, please report the following value from your AdminCP:
      Settings > Options > Message Posting and Editing Options > Minimum Characters Per Post

      Code:
      #REDIRECT [[Page Name]]
      Is shorter than:
      Code:
      [redirect]Page Name[/redirect]
      By several characters, and may explain if the original redirect was never imported, meanwhile you can create the latter. This is provided you're unlucky enough to have mostly redirects that are the same character length, and the minimum characters setting happens to fall right in the middle.
      Reply Reply  
    4. November 5, 2011 6:09 AM
      Lord Doys Lord Doys is offline
      Junior Member
      actually it turned out to be two different problems with the redirects

      1: yes none of the redirects that were imported werent converted (see code post below) i manually updated them with queries, mysql replace
      2: redirects that were linking from Main to another namespace
      it wasnt the min number of posts, it was 10 at the import, and recently turned to 5.
      but the strange thing is, that not ALL were left out. and looking at the log of my script if i cant find a pattern why 3000 redirects didnt make it, while others did...
      beats me..

      heres a list of a few pages that didnt make it to the VW-wiki on import:
      Code:
      checking: Detect Secret Doors
      we got a false one! Detect Secret Doors
      post: Detect Secret Doors - [redirect]D20:Detect_Secret_Doors_(Spell)[/redirect]
      checking: Detect Snares and Pits
      we got a false one! Detect Snares and Pits
      post: Detect Snares and Pits - [redirect]D20:Detect_Snares_and_Pits_(Spell)[/redirect]
      checking: Detect Teleportation
      we got a false one! Detect Teleportation
      post: Detect Teleportation - [redirect]D20:Detect_Teleportation_(Power)[/redirect]
      checking: Detect Thoughts
      we got a false one! Detect Thoughts
      post: Detect Thoughts - [redirect]D20:Detect_Thoughts_(Spell)[/redirect]
      checking: Detect Undead
      we got a false one! Detect Undead
      post: Detect Undead - [redirect]D20:Detect_Undead_(Spell)[/redirect]
      checking: Detect undead (Spell)
      we found one! Detect undead (Spell)
      checking: Devastating Critical (SRD Epic Feat)
      we got a false one! Devastating Critical (SRD Epic Feat)
      post: Devastating Critical (SRD Epic Feat) - [redirect]D20:Devastating_Critical_(Epic_Feat)[/redirect]
      checking: Devastating Critical
      we got a false one! Devastating Critical
      post: Devastating Critical - [redirect]D20:Devastating_Critical_(Epic_Feat)[/redirect]
      checking: Developing Epic Spells (SRD Epic Spell Seed)
      we got a false one! Developing Epic Spells (SRD Epic Spell Seed)
      post: Developing Epic Spells (SRD Epic Spell Seed) - [redirect]D20:Developing_Epic_Spells_(Epic_Spell_Seed)[/redirect]
      the problem isnt the special chars like ( ) . ' becaus some pages with those, did make it.
      Reply Reply  
    5. November 5, 2011 7:01 AM
      Lord Doys Lord Doys is offline
      Junior Member
      below is an example of what happened with the conversion (ie problem 1 from post above)

      Code:
      -
      #Redirect [[Vassal]]
      
      +
      [list=1][*]Redirect [wiki]Vassal[/wiki][/LIST]
      this could indeed be the min characters..
      Reply Reply  
    6. November 5, 2011 7:40 AM
      Lord Doys Lord Doys is offline
      Junior Member
      just found i still missed some with the queries.. (80+ pages)

      pages like http://www.birthright.net/forums/showwiki.php?title=CJS
      which have code like
      Code:
      [list=1][*]Redirect [wiki]Celestial Jewel of Sarimie[/wiki]
      [/redirect]
      these DO have more the 10 chars.. but were converted as LIST instead of redirect
      Reply Reply  
    7. November 5, 2011 3:45 PM
      pegasus pegasus is offline
      VaultWiki Team
      Reproduced and fixed. In vault/functions/bbcode.php, find:
      Code:
      		$parsers = array(
      			'wiki' => array(
      Add after:
      Code:
      				'vb_wikiconvertparser',
      Reply Reply  
    8. November 5, 2011 4:03 PM
      pegasus pegasus is offline
      VaultWiki Team
      To fix incorrectly converted redirects, what you want to do is get a list of the page IDs from the MediaWiki database's page table:
      Code:
      WHERE page_is_redirect = 1
      Preferably the results should be output and formatted as a comma separated list of IDs, to be used in a moment by VaultWiki.

      Then modify admincp/vaultwiki_tools.php so that:
      Code:
      	$posts = $db->query_read("
      		SELECT post.postid, post.pagetext, thread.forumid, thread.title,
      			thread.firstpostid, thread.threadid, post.visible,
      			" . (!VAULT_36X_COMPAT ? "thread.prefixid, " : "") . "
      			post.userid, user.usergroupid, user.membergroupids
      		FROM " . TABLE_PREFIX . "thread AS thread
      		LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.threadid = thread.threadid AND post.parentid = 0)
      		LEFT JOIN " . TABLE_PREFIX . "user AS user ON (post.userid = user.userid)
      		WHERE thread.forumid IN (-1" . $allarticles . ")
      		GROUP BY thread.threadid
      		ORDER BY post.postid DESC
      		LIMIT " . $startat . "," . $per_post_query . "
      	");
      Becomes:
      Code:
      	$posts = $db->query_read("
      		SELECT post.postid, post.pagetext, thread.forumid, thread.title,
      			thread.firstpostid, thread.threadid, post.visible,
      			" . (!VAULT_36X_COMPAT ? "thread.prefixid, " : "") . "
      			post.userid, user.usergroupid, user.membergroupids
      		FROM " . TABLE_PREFIX . "thread AS thread
      		LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.threadid = thread.threadid AND post.parentid = 0)
      		LEFT JOIN " . TABLE_PREFIX . "user AS user ON (post.userid = user.userid)
      		WHERE thread.import_page_id IN (COMMA SEPARATED LIST OF PAGE IDS)
      		ORDER BY post.postid DESC
      		LIMIT " . $startat . "," . $per_post_query . "
      	");
      Then, find:
      Code:
      			$threadinfo = fetch_threadinfo($post['threadid']);
      Add after:
      Code:
      $text = preg_replace('#\[list=1\]\[\*\]Redirect (.*)\s*\[/list\]#si', '[redirect]\1[/redirect]', $post['pagetext']);
      
      			$revision = array(
      				'threadid' => $threadinfo['threadid'],
      				'pagetext' => $text
      			);
      
      			revision_quick_update($revision, $foruminfo, $threadinfo, $post, array(
      				'is_automated' => true
      			));
      Then run the converter again to fix the botched redirects that were already imported.
      Reply Reply  
    9. November 6, 2011 5:00 AM
      Lord Doys Lord Doys is offline
      Junior Member
      thnx again
      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:33 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.