• 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
    • Article titles containing "&" will not link properly after edit

    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: Article titles containing "&" will not link properly after edit

    • Issue Tools
      • View Changes
    1. issueid=2005 September 25, 2010 8:43 AM
      lordsilence lordsilence is offline
      Junior Member
      Article titles containing "&" will not link properly after edit
      Article titles containing "&" will cause issues when editing article

      When editing an article with an & in the title - after hitting save you get reditected back to the article.
      The issue is now that the article doesnt exist under that link.

      Original title link name in browser bar (before editing):
      Something+and+Something+else

      After editing:
      Something+and+amp+Something+else

      Going into the article again through wiki list doesnt work, the link goes to the wrong one.
      However if you go into edit mode of the non existant article, change the browser URL manually to remove +amp it goes to the proper article for editing. But it's not possible to rename it properly through the edit window.

      Also if you try to edit the name of the article in forum view using the new ajax menu hitting "save" only greys out the "save" option and ajax window doesnt close. You can cancel to exit the window, but it doesnt seem to do any changes to the title.

      Disabling wiki, then moving article out. Renaming it to something without "&" sign in title and then moving it back in + enabling wiki fixes the link issue for the particular entries.
    Issue Details
    Issue Number 2005
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Wiki Pages
    Status Fixed
    Priority 5 - Minor Bugs / Small Tweaks
    Affected Version 3.0.4
    Fixed Version 3.0.5
    Milestone VaultWiki 3.0.5
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. September 25, 2010 12:56 PM
      pegasus pegasus is offline
      VaultWiki Team
      The title issue is a duplicate of a previous issue with 3.0.3, the fix is here: http://www.vaultwiki.org/issues/1958/#note9543

      For the second issue, in template vault_edit_title find:
      Code:
              </fieldset>
      Add before:
      Code:
                      <if condition="$show['rename_redirect']">
                      <div class="fieldset" style="padding:$stylevar[formspacer]px">
                      <label for="cb_renred"><input type="checkbox" name="rename_redirect" id="cb_renred" tabindex="1" value="1" $checked[rename] /> $vbphrase[vault_dont_redirect]</label>
                          </div>
                      <else />
                      <input type="hidden" name="rename_redirect" value="$rename_redirect_value" />
                      </if>
      Reply Reply  
    2. September 25, 2010 6:21 PM
      lordsilence lordsilence is offline
      Junior Member
      Confirming that the ajax renaming function still doesnt handle & signs in names of articles that well.
      It will try to encode it and put into db messing up revision history.

      Same goes with revisions, it links left and right with the wrong encoding.
      This is a critical bug that will most likely mess up a lot of people who ever had an & in the article title.
      Reply Reply  
    3. September 25, 2010 7:33 PM
      pegasus pegasus is offline
      VaultWiki Team
      So even after the file edits in the other thread, it's still not working? This is odd since it is working fine here for me.
      Reply Reply  
    4. September 26, 2010 6:59 AM
      lordsilence lordsilence is offline
      Junior Member
      It is possible that is caused by the thread being removed oddly and then attempt to be linked back in again.
      I reverted my forum to an earlier backup and hoping for a new patch which has this bugfix in the templates as well as the other reported bug. I dont know how it links back and forth between revisions but the edit button and save would redirect to the wrong article after hitting save.
      I checked revision table manually and the the url title also got named oddly. It looked like the title in revisions was written as "Something & something else" instead of "Something & something else" when making edits. Subsequent edits would then not be able to be reverted, no text would show when clicking cur or checking the revisions.


      (This was found out after the section edits started over-writing ontop of head instead on in-place editing and we tried to revert changes - see other bug report.)

      I will open up wiki once a new patch is published which fixes the template issues.
      I've reverted the whole forum now so the installed wiki is a 3.0.4 without the template fix in place.
      I suppose a fix will be automaticly applied with next update?
      Reply Reply  
    5. September 26, 2010 1:55 PM
      pegasus pegasus is offline
      VaultWiki Team
      Both "&" and "&" in the revisions table should resolve to the same pages, because they would both be completely removed from the URL - or if you have the URL replacement, both would be replaced by the word "and". You would only have a problem if this also appeared as the title in the editor.

      You need to fix it using the AJAX title change as I mentioned above. Double click the title, enter "Something & something else", even if it already looks correct, and tell it NOT to create a redirect. The problem was that 3.0.3 didn't save encoded characters in the title in a consistent form. Of course you'll need to make that template edit before the save will go through...

      You may also be able to do AdminCP > VaultWiki > Wiki URL Manager > Rebuild Page URLs, but I'm not sure if this will fix the issue with the encoding mismatch.
      Reply Reply  
    6. September 27, 2010 7:05 PM
      lordsilence lordsilence is offline
      Junior Member
      Ok, I've applied these fixes.
      If I edit the title name it will still add an & in the forum listing name and article title name.
      Subsequent changes, and saving a redirect will make it list as & .

      The "workaround" for now is to avoid using & in title names since the encoding forces title to be & and the & will encode to & .
      The article wont be brought up correctly if you click the title, but using the
      "Rebuild wiki URLs" in adminCP fixes it.


      The ajax fix still doesnt work - for example leftclicking besides a title in forum listing in wiki brings up the ajax view but hitting save doesnt close the window and apply changes (with or without prevent redirect).
      This is my template after the proposed fix:

      Code:
      <form action="wiki_ajax.php?do=title-update" method="post" name="vbform">
      <input type="hidden" name="s" value="$session[sessionhash]" />
      <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
      <input type="hidden" name="do" value="title-update" />
      <input type="hidden" name="t" value="$threadinfo[threadid]" />
      <input type="hidden" name="poststarttime" value="$poststarttime" />
      <input type="hidden" name="url" value="$url" />
      
      <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
      <tr>
      	<td class="tcat" align="$stylevar[left]">$subject</td>
      </tr>
      <tr>
      	<td class="panelsurround" align="center">
      	<div class="panel">
      		<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
      
      
      		<fieldset class="fieldset">
      			<legend>$vbphrase[title]</legend>
      			<div class="fieldset" style="padding:$stylevar[formspacer]px">
      				<label for="tb_title">$vbphrase[title]: <input type="text" name="title" value="$subject" id="tb_title" /></label>
      				<if condition="$prefix_options">
      				<select name="prefixid" class="bginput" tabindex="1">
      					<if condition="$show['empty_prefix_option']"><option value=""></option></if>
      					$prefix_options
      				</select>
      				</if>
      			</div>
                      <if condition="$show['rename_redirect']">
                      <div class="fieldset" style="padding:$stylevar[formspacer]px">
                      <label for="cb_renred"><input type="checkbox" name="rename_redirect" id="cb_renred" tabindex="1" value="1" $checked[rename] /> $vbphrase[vault_dont_redirect]</label>
                          </div>
                      <else />
                      <input type="hidden" name="rename_redirect" value="$rename_redirect_value" />
                      </if>
      		</fieldset>
      
      		</div>
      	</div>
      
      	<div style="margin-top:$stylevar[cellpadding]px">
      		<input type="submit" class="button" id="save_btn" value="$vbphrase[save]" accesskey="s" tabindex="1" />
      		<input type="button" class="button" id="cancel_btn" value="$vbphrase[cancel]" accesskey="c" tabindex="1" />
      	</div>
      	</td>
      </tr>
      </table>
      
      </form>
      Why isnt the standard forum fashion used for renaming articles?
      It used to work perfectly fine with the normal rightclick and the title editable in-place.
      Reply Reply  
    7. September 27, 2010 9:35 PM
      pegasus pegasus is offline
      VaultWiki Team
      It has never worked fine for wiki articles. Changing the title via AJAX would result in the text being dissociated from the URL. I'm not sure what the issue is for you anymore. Duplicated your issue on my fresh vB 3.8.6 install, performed the file edits linked on page 1, and can no longer duplicate the issue.

      The AJAX save is still failing because the forum doesn't use thread prefixes. Fixing this for the next build.
      Reply Reply  
    8. September 27, 2010 9:59 PM
      lordsilence lordsilence is offline
      Junior Member
      I think you are adressing one of the two remaining problem.
      The AJAX saves in next build.

      What remains is an encoding issue for the title, when an article is edited.

      Okay, this is what I did to reproduce my issue

      Create a new article called

      Test 1 2 & / % ( & )

      The new article is created with proper name and is clickable.

      Going into article works fine and I can start editing.
      However, when saving article with a title change (no redirect clicked) to:

      Test 1 2 & / % ( Something & else )
      Results in the url showwiki.php?title=Test+article+and+amp+something+and+amp +something+else&redirect=no being loaded on save and of course no article text showing up.

      The saved article when going back to the article list shows up with the following name:
      Test article &amp; % / ( something &amp; something else )

      Clicking this article links to an empty "create article page" .
      However if I then rebuild URLs I get to the proper article, although with the wrong title (encoded characters).

      From there I can rename it to somehting without &'s in it and the title is fine.
      I can also delete it properly ending the test.
      Reply Reply  
    9. September 27, 2010 10:06 PM
      pegasus pegasus is offline
      VaultWiki Team
      Yes this is the same issue and was solved by the edits in the other thread. From your explanation, it sounds like you missed the edit for vault/tab/edit.php. It's possible you edited vault/tabs/edit.php by mistake if you never deleted vault/tabs when you upgraded to VaultWiki 3.
      Reply Reply  
    10. September 27, 2010 11:55 PM
      lordsilence lordsilence is offline
      Junior Member
      It's kind of hard to keep track of update steps when you try to follow the zip copy archive update / overwrite old installation.
      Then fix bugs by manual search/replace in between versions.

      I missed that you specified one fix linking to another thread and then adding a secondary fix.
      Ill apply the fixes you proposed on the linked thread.
      Reply Reply  
    11. September 28, 2010 12:10 AM
      lordsilence lordsilence is offline
      Junior Member
      Minor edit. (UPDATE: Read my next post too! Some of the stuff in this post is inaccurate.)
      I applied the changes proposed in http://www.vaultwiki.org/issues/1958/#note9543

      Tried setting up a new article:
      Test article & % / ( & )

      This fixes the revision page. When you edit and change the title the title is redirected to the proper article and displayed properly in the article you access via:
      showwiki.php?title=Test+article+and+something+and+else&do =edit
      It does however strip out the ( ) after an edit:
      Article becomes
      Test article & % / something & else

      Another problem still remains on the thread view.
      The changed title on the thread view still shows "Test article &amp; % / ( &amp; )" after an edit
      Linking to : showwiki.php?title=Test+article+and+amp+and+amp

      I can still rebuild URLs and then it links properly.
      So the proposed fix seemed to fix half the problems, and also strips out some characters out of URL (although this might be by design?).

      What might I have missed to make the thread list also show correct link and text after an edit?

      Files that I applied changes to:
      vault/tab/edit.php
      vault/dm/revision.php

      Be aware that the section you specified for replacement differed on one point from the "search" point.
      trying to find this line had no result: $threadman->set('title', unhtmlspecialchars($this->fetch_field('title'), true));
      But $threadman->set('title', unhtmlspecialchars($this->fetch_field('title'))); existed.
      Reply Reply  
    12. September 28, 2010 12:16 AM
      lordsilence lordsilence is offline
      Junior Member
      Yet another update and correction:
      Renaming "does" work, it creates the thread title properly. I had simply forgot to check "no redirect".

      What I saw was the "redirect" title that got created when I forgot to mark "do not create redirect".
      It seems like the redirect function tries to encode the title still.

      I guess that is still a bug incase someone wants to create a redirect, and the redirected title creates a wrongfully encoded "old" title.
      Manual URL rebuild did fix the link to the redirect.
      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:14 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.