Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1.6, 2.2.3, 2.3
    • Fix Version/s: 2.1.7, 2.2.4
    • Component/s: Wiki (2.x)
    • Labels:
    • Environment:
      any
    • Testing Instructions:
      Hide

      1. Create a wiki.
      2. Edit a page and include header (h1) elements.
      3. Jump within the Wiki page using the TOC.
      4. You should be able to jump to the heading (h1) text that you clicked on from the TOC.

      5. You might want to purge all caches.

      Show
      1. Create a wiki. 2. Edit a page and include header (h1) elements. 3. Jump within the Wiki page using the TOC. 4. You should be able to jump to the heading (h1) text that you clicked on from the TOC. – 5. You might want to purge all caches.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-25695-master
    • Rank:
      15125

      Description

      If text is formated as H1 a Toc is created on top of the wiki page. The text of headline is created as a link, But it didn't jump to the element in the page.

      1. mdl-25695-noanchors.patch
        0.6 kB
        Charles Fulton
      1. wiki.png
        28 kB

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi Ralf, can you plz comment a bit more about the meaningful wiki/page settings to reproduce this? html/wiki format, example contents to reproduce, anything special... TIA!

          Show
          Eloy Lafuente (stronk7) added a comment - Hi Ralf, can you plz comment a bit more about the meaningful wiki/page settings to reproduce this? html/wiki format, example contents to reproduce, anything special... TIA!
          Hide
          Ralf Hilgenstock added a comment -

          Sure. I use HTML format. After saving a page with H1-formatting a anchor link in the page is created, but is doesn't work. If you click at the link to the second headline it should jump to the place at the page. But it didn't

          Show
          Ralf Hilgenstock added a comment - Sure. I use HTML format. After saving a page with H1-formatting a anchor link in the page is created, but is doesn't work. If you click at the link to the second headline it should jump to the place at the page. But it didn't
          Hide
          Molly McManus added a comment -

          I'm seeing the same thing in our test.

          Show
          Molly McManus added a comment - I'm seeing the same thing in our test.
          Hide
          Molly McManus added a comment -

          seeing this in all three wiki formats

          Show
          Molly McManus added a comment - seeing this in all three wiki formats
          Hide
          Charles Fulton added a comment -

          I'm poking at this; there are no anchor tags being generated in the body of the text.

          Show
          Charles Fulton added a comment - I'm poking at this; there are no anchor tags being generated in the body of the text.
          Hide
          Charles Fulton added a comment -

          Correction: there are empty anchor tags without names.

          Show
          Charles Fulton added a comment - Correction: there are empty anchor tags without names.
          Hide
          Charles Fulton added a comment -

          As I suspected HTMPurifier is stripping out the anchors. Adding a directive to weblib.php seems to correct the behavior.

          Show
          Charles Fulton added a comment - As I suspected HTMPurifier is stripping out the anchors. Adding a directive to weblib.php seems to correct the behavior.
          Show
          Charles Fulton added a comment - Patch here: https://github.com/mackensen/moodle/commit/25dfafe0159e5a64bc85969e68d3f7f6dea639f4 .
          Hide
          Sunner Sun added a comment - - edited

          I meet the same problem in Moodle 2.1.1 and Charles's patch does work (do not forget to purge cache)! Thanks!

          The patch is simple. It just set a flag in purify_html(). Why not merge it ASAP?

          Show
          Sunner Sun added a comment - - edited I meet the same problem in Moodle 2.1.1 and Charles's patch does work (do not forget to purge cache)! Thanks! The patch is simple. It just set a flag in purify_html(). Why not merge it ASAP?
          Hide
          Charles Fulton added a comment -

          Verified that this is still an issue in 2.3dev.

          Show
          Charles Fulton added a comment - Verified that this is still an issue in 2.3dev.
          Hide
          Mayank Gupta added a comment -

          Looks fine.
          Tested it as well. Works great.

          Thanks,
          Mayank.

          Show
          Mayank Gupta added a comment - Looks fine. Tested it as well. Works great. Thanks, Mayank.
          Hide
          Justin Sossin added a comment -

          I added the additional line of code "$config->set('Attr.EnableID', true);" within the weblib.php file located within \server\moodle\lib\ directory in the specific location pointed out in https://github.com/mackensen/moodle/compare/MOODLE_21_STABLE...MDL-25695-21. Restarted the moodle, cleared my browsers cache and the TOC(table of contents) links are working.

          Show
          Justin Sossin added a comment - I added the additional line of code "$config->set('Attr.EnableID', true);" within the weblib.php file located within \server\moodle\lib\ directory in the specific location pointed out in https://github.com/mackensen/moodle/compare/MOODLE_21_STABLE...MDL-25695-21 . Restarted the moodle, cleared my browsers cache and the TOC(table of contents) links are working.
          Hide
          Dan Poltawski added a comment -

          Hi Charles,

          Not sure this is the right solution, as a few lines below we have:

          if ($type === 'allowid') {
               $config->set('Attr.EnableID', true);
          }
          

          cheers,
          dan

          Show
          Dan Poltawski added a comment - Hi Charles, Not sure this is the right solution, as a few lines below we have: if ($type === 'allowid') { $config->set('Attr.EnableID', true ); } cheers, dan
          Hide
          Charles Fulton added a comment -

          Amended based on the fix provided in MDL-26423 (thanks Dan, I hadn't noticed that development).

          Show
          Charles Fulton added a comment - Amended based on the fix provided in MDL-26423 (thanks Dan, I hadn't noticed that development).
          Hide
          Dan Poltawski added a comment -

          Thanks Charles, sorry I didn't see this quicker.

          Submitting for integration

          Show
          Dan Poltawski added a comment - Thanks Charles, sorry I didn't see this quicker. Submitting for integration
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Aparup Banerjee added a comment -

          Thanks, the patch has been integrated into 21, 22 and master for testing.

          Show
          Aparup Banerjee added a comment - Thanks, the patch has been integrated into 21, 22 and master for testing.
          Hide
          Adrian Greeve added a comment -

          Tested with version 2.1, 2.2 and master. Navigation through the table of contents now works, though html only created links for heading 1. The other formats create linked headings that navigate properly.
          Thanks.

          Show
          Adrian Greeve added a comment - Tested with version 2.1, 2.2 and master. Navigation through the table of contents now works, though html only created links for heading 1. The other formats create linked headings that navigate properly. Thanks.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          U P S T R E A M I Z E D !

          Many thanks for the hard work, closing this as fixed.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - U P S T R E A M I Z E D ! Many thanks for the hard work, closing this as fixed. Ciao

            People

            • Votes:
              8 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: