• 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
    • Error When Changing a Page's Language

    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: Error When Changing a Page's Language

    • Issue Tools
      • View Changes
    1. issueid=1422 April 13, 2010 3:47 PM
      Mokonzi Mokonzi is offline
      Senior Member
      Error When Changing a Page's Language
      Error When Changing a Page's Language

      When I tried to Change an Article's Language (this is with a new namespace called Reviews), I got the following vB error: It occured when I selected English to German and selected Apply.

      I'm not certain if this is partially because the site doesn't have a full translation of the German phrases or not.
      Code:
      Database error in vBulletin 4.0.3:
      
      Invalid SQL:
      
      		SELECT thread.threadid, thread.title, thread.forumid, art.languageid
      			, thread.prefixid
      		FROM vb3_thread AS thread
      		INNER JOIN vb3_vault_article AS art ON (art.threadid = thread.threadid)
      		WHERE thread.threadid IN ();
      
      MySQL Error   : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5
      Error Number  : 1064
      Request Date  : Tuesday, April 13th 2010 @ 11:42:50 PM
      Error Date    : Tuesday, April 13th 2010 @ 11:42:52 PM
      Script        : /showwiki/Reviews:Terraner Sleipnir dt Review?do=apply
      Referrer      : /showwiki/Reviews:Terraner+Sleipnir+dt+Review
      PS, could you add a "Translation" option to the Categories here in the Support Project?
    Issue Details
    Issue Number 1422
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Language / Phrasing
    Status Fixed
    Priority 1 - Security / Login / Data Loss
    Affected Version 3.0.0 RC 1
    Fixed Version 3.0.0 RC 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. April 13, 2010 4:26 PM
      pegasus pegasus is offline
      VaultWiki Team
      It's nearly impossible for you to have gotten this error... It essentially means that the page whose Apply tab you're on doesn't exist.

      The only way I can imagine this occurring is if the page was a thread in the forum before the forum became the Top-level forum of the namespace.

      I suppose this error can be avoided in this rare case if we add a sanity check. In vault/tabs/special_tab_apply.php, find:
      Code:
      	$translations = $db->query_first("
      		SELECT *
      		FROM " . TABLE_PREFIX . "vault_language
      		WHERE $currentfield = " . intval($threadinfo['threadid']) . "
      	");
      Add after:
      Code:
      	if (empty($translations))
      	{
      		// this article was corrupted at some point, attempt fix
      		$db->query_write("
      			INSERT INTO " . TABLE_PREFIX . "vault_language
      				($currentfield)
      			VALUES
      				(" . intval($threadinfo['threadid']) . ")
      		");
      
      		$translations = array($currentfield => intval($threadinfo['threadid']));
      	}
      Reply Reply  
    2. April 13, 2010 5:11 PM
      Mokonzi Mokonzi is offline
      Senior Member
      Thinking about it, it is possible that scenario for that page, or the other one may be that it was moved from a regular forum, but I'm fairly certain that didn't happen in this instance.

      Will add the fix in the morning (my time)
      Reply Reply  
    3. April 14, 2010 2:47 AM
      Mokonzi Mokonzi is offline
      Senior Member
      I applied the fix. You put the file down as the special_tab_edit, when it's special_tab_apply that was the file with the content I needed to add to.

      Problem is that it won't hold the language change. It will say it's saved the changes, and it does this in the German language phrase, but then reloads in English (as I supposed is the case because I'm using the English language), but the page is still listed as 'English', even though there are no options in the View in Language: option (Not even English). When I reload the page, that's changed back to having only English available. If I switch to German, it's still only English, and forces my language back to English. The article hasn't saved the language settings.

      So sumarizing, it seems it won't save the language the article has been changed to, and this may be because I've viewing it in a different language to which it wants, but then I need to to see the article in the first place. Perhaps that's the issue in why it won't save.
      Reply Reply  
    4. April 14, 2010 3:06 AM
      pegasus pegasus is offline
      VaultWiki Team
      I can confirm. Looking at the code again, it seems that changing the language here only updates the translation records, but doesn't actually change the language of the article itself (or its prefix, URL, etc). This is going to require a bit of code to be added. I've put this on my to-do list for the morning (my time).
      Reply Reply  
    5. April 14, 2010 1:10 PM
      pegasus pegasus is offline
      VaultWiki Team
      Not sure if this is completely fixed yet, but here are some more edits for vault/tabs/special_tab_apply.php. Find:
      Code:
      			$errors[] = 'vault_cannot_changelang_error';
      		}
      Replace with:
      Code:
      			$errors[] = 'vault_cannot_changelang_error';
      			$show['apply_languageid'] = false;
      		}
      
      		$dbtitle = array(
      			'threadid' => $threadinfo['threadid'],
      			'title' => $threadinfo['title'],
      			'prefixid' => $threadinfo['prefixid'],
      			'forumid' => $threadinfo['forumid'],
      			'languageid' => $edit['languageid']
      		);
      
      		$newtitle = $dbtitle;
      		$newtitle['languageid'] = $threadinfo['languageid'];
      
      		$vault->urlgenerate($dbtitle);
      		$vault->urlgenerate($newtitle);
      
      		if ($dbtitle['encshort'] != $newtitle['encshort'])
      		{
      			require_once(DIR . '/vault/special_plugins_newpost.php');
      
      			$existing = special_read_article_title($newtitle['title'], $newtitle['forumid'], false, $newtitle['languageid']);
      
      			if ($existing['threadid'] != $newtitle['threadid'])
      			{
      				$errors[] = 'vault_langpage_exists_error';
      				$show['apply_languageid'] = false;
      			}
      		}
      Find:
      Code:
      				if (!$langupdate['translate_' . $edit['languageid']])
      				{
      					$db->query_write("
      						REPLACE INTO " . TABLE_PREFIX . "vault_language
      							(translate_" . intval($edit['languageid']) . ")
      						VALUES
      							(" . intval($threadinfo['threadid']) . ")
      					");
      				}
      Add after:
      Code:
      				if ($show['apply_languageid'])
      				{
      					special_save_new_links($newtitle['threadid'], $newtitle['title'], $newtitle['forumid'], false, true, $newtitle['languageid']);
      
      					if ($newtitle['encshort'] != $dbtitle['encshort'])
      					{
      						$vbulletin->input->clean_gpc('p', 'rename_redirect', TYPE_BOOL);
      
      						if ($threadinfo['protection'])
      						{
      							$db->query_write("
      								UPDATE " . TABLE_PREFIX . "vault_protect
      								SET title_lower = '" . $db->escape_string($vault->strtolower($newtitle['encshort'])) . "'
      								WHERE targetid = " . intval($newtitle['threadid']) . "
      							");
      						}
      
      						if (!$vbulletin->GPC['rename_redirect'])
      						{
      							special_article_creator(
      								unhtmlspecialchars($dbtitle['title']),
      								'[redirect]' . unhtmlspecialchars($newtitle['title']) . '[/redirect]',
      								$dbtitle['forumid'],
      								array(),
      								$dbtitle['languageid']
      							);
      						}
      					}
      				}
      Reply Reply  
    6. April 15, 2010 6:53 PM
      pegasus pegasus is offline
      VaultWiki Team
      Marking this as fixed until you or someone else petitions this issue.
      Reply Reply  
    7. April 16, 2010 3:27 AM
      Mokonzi Mokonzi is offline
      Senior Member
      First opportunity I've had to get a go to implement the fix. Still not getting the problem sorted. It's holding on to it's English tag:

      1. http://www.thexuniverse.com/showwiki...pnir+dt+Review
      2. http://www.thexuniverse.com/showwiki...nir+eng+Review


      No 1 is the German article, number 2 the English equivalent. I've tried adding the German article to the translation list in the English article, but so far I've only got the option to read in English. Perhaps because the German article is still tagged English. No matter what I try, it won't hold the German tag to it.

      Have a play with it yourself so you can see what I mean.

      I've not yet tried translating a page using the translate option, I'll try and get on to that this evening.
      Reply Reply  
    8. April 16, 2010 8:51 AM
      pegasus pegasus is offline
      VaultWiki Team
      Forgot probably the most important part. In vault/tabs/special_tab_apply.php, find:
      Code:
      					special_save_new_links($newtitle['threadid'], $newtitle['title'], $newtitle['forumid'], false, true, $newtitle['languageid']);
      Add after:
      Code:
      					$db->query_write("
      						UPDATE " . TABLE_PREFIX . "vault_article
      						SET languageid = " . intval($newtitle['languageid']) . "
      						WHERE threadid = " . intval($newtitle['threadid']) . "
      					");
      Reply Reply  
    9. April 16, 2010 12:49 PM
      Mokonzi Mokonzi is offline
      Senior Member
      Still not getting any success on it saving either the Language for the article, or adding a 'German' version to another article.

      I've even tried rebuilding the cache in case it was that which was causing the problem. The Apply tab came out more recently than the translations I've got for the German (Still got two versions to catch up on), is it possible that not having all the German phrases is causing the issue here? Plus, it's not a regular Wiki namespace, and is a specially created Reviews namespace, is that an issue?
      Reply Reply  
    10. April 16, 2010 1:07 PM
      pegasus pegasus is offline
      VaultWiki Team
      I will have to try this over at my vB 3.8 forum since I can't test this on vaultwiki.org (we only have 1 language on here).
      Reply Reply  
    11. April 16, 2010 1:18 PM
      Mokonzi Mokonzi is offline
      Senior Member
      No problem, feel free to have a look at how it works on my site as well, you've still got Admin access.
      Reply Reply  
    12. April 16, 2010 3:00 PM
      Mokonzi Mokonzi is offline
      Senior Member
      A couple of slight issues with the translation of an article as detailed in this bug report: http://www.vaultwiki.org/issues/1436/
      Reply Reply  
    13. April 16, 2010 4:54 PM
      pegasus pegasus is offline
      VaultWiki Team
      Managed to fix this issue completely on my 3.8.x site. You'll have to download the current ZIP again and replace the vault/tabs/special_tab_apply.php. Then, you'll need to rebuild the translation data on the untranslateable pages using the Apply tab to save the language (even if the correct language is displayed on the tab).
      Reply Reply  
    14. April 16, 2010 5:45 PM
      Mokonzi Mokonzi is offline
      Senior Member
      I currently can't access the apply tab, it's a perpetual loading symbol, with no data coming up, on any article I check.

      I rebuilt the namespace but no difference.
      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:19 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.