• 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
    • Editing sections inside articles overwrites from the top of article page

    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: Editing sections inside articles overwrites from the top of article page

    • Issue Tools
      • View Changes
    1. issueid=2006 September 25, 2010 5:48 PM
      lordsilence lordsilence is offline
      Junior Member
      Editing sections inside articles overwrites from the top of article page

      Doing an in-place edit on a section just overwrites the changes ontop of the text starting from the very top of article.

      For example

      Trying to edit article


      Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text
      Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text Lots of text

      My new section [edit]
      Some section stuff here.
      Something I change here

      Puts Something I change here on the same row from top of article overwriting the row edited in section. In this case row 2 and puts it ontop of text from beginning of document.
    Issue Details
    Issue Number 2006
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Editing / Posting Articles
    Status Fixed
    Priority 3 - Loss of Functionality
    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 7:42 PM
      pegasus pegasus is offline
      VaultWiki Team
      Confirmed. This is strange since the code for this wasn't really changed, it was just moved to a different file...
      Reply Reply  
    2. September 26, 2010 7:10 AM
      lordsilence lordsilence is offline
      Junior Member
      Changed the priority since this is litteraly eating articles alive if using section editing.
      Reply Reply  
    3. September 26, 2010 1:37 PM
      pegasus pegasus is offline
      VaultWiki Team
      Fixed in the current ZIP. In vault/class/segregate.php, find:
      Code:
          function get_section($postid, $section, &$title, $include_header = false)
          {
              if ($this->sections["$postid"]["$section"] === null)
              {
                  return null;
              }
      
              $section_pos = $this->sections["$postid"]["$section"][($include_header ? 'header_' : '') . 'pos'];
              $title = $this->sections["$postid"]["$section"]['head'];
              $length = strlen($this->sections["$postid"]["$section"]['text']);
      
              if ($include_header)
              {
                  $length += $this->sections["$postid"]["$section"]['pos'] - $section_pos;
              }
      
              return rtrim(substr(
                  $this->text["$postid"]['orig'],
                  $section_pos,
                  $length
              ));
          }
      Replace with:
      Code:
          function get_section($postid, $section, $include_header = false)
          {
              if ($this->sections["$postid"]["$section"] === null)
              {
                  return null;
              }
      
              $section_pos = $this->get_section_pos($postid, $section, $include_header);
              $length = strlen($this->sections["$postid"]["$section"]['text']);
      
              if ($include_header)
              {
                  $length += $this->get_section_pos($postid, $section) - $section_pos;
              }
      
              return rtrim(substr(
                  $this->text["$postid"]['orig'],
                  $section_pos,
                  $length
              ));
          }
      
          function get_section_pos($postid, $section, $header = false)
          {
              if ($this->sections["$postid"]["$section"] === null)
              {
                  return 0;
              }
      
              return $this->sections["$postid"]["$section"][($header ? 'header_' : '') . 'pos'];
          }
      
          function get_section_title($postid, $section)
          {
              if ($this->sections["$postid"]["$section"] === null)
              {
                  return '';
              }
      
              return $this->sections["$postid"]["$section"]['head'];
          }
      In wiki_ajax.php, find:
      Code:
                      $postinfo['pagetext'] = $segregator->get_section($postinfo['postid'], 1, $title, true);
      Replace with:
      Code:
                      $postinfo['pagetext'] = $segregator->get_section($postinfo['postid'], 1, true);
      In vault/functions/postbit.php, find:
      Code:
              return $segregator->get_section($postid, $fetch_section, $title);
      Replace with:
      Code:
              $section_pos = $segregator->get_section_pos($postid, $fetch_section);
              $title = $segregator->get_section_title($postid, $fetch_section);
      
              return $segregator->get_section($postid, $fetch_section, $title);
      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 7:03 PM.
    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.