Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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.

        Gliffy Diagrams

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

          Issue Links

            Activity

            Hide
            stronk7 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
            stronk7 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
            ralfh 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
            ralfh 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
            signsmj@millsaps.edu Molly McManus added a comment -

            I'm seeing the same thing in our test.

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

            seeing this in all three wiki formats

            Show
            signsmj@millsaps.edu Molly McManus added a comment - seeing this in all three wiki formats
            Hide
            cfulton Charles Fulton added a comment -

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

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

            Correction: there are empty anchor tags without names.

            Show
            cfulton Charles Fulton added a comment - Correction: there are empty anchor tags without names.
            Hide
            cfulton 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
            cfulton 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
            cfulton Charles Fulton added a comment - Patch here: https://github.com/mackensen/moodle/commit/25dfafe0159e5a64bc85969e68d3f7f6dea639f4 .
            Hide
            sunner 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 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
            cfulton Charles Fulton added a comment -

            Verified that this is still an issue in 2.3dev.

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

            Looks fine.
            Tested it as well. Works great.

            Thanks,
            Mayank.

            Show
            mayank_gupta2005 Mayank Gupta added a comment - Looks fine. Tested it as well. Works great. Thanks, Mayank.
            Hide
            justins 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
            justins 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
            poltawski 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
            poltawski 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
            cfulton Charles Fulton added a comment -

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

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

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

            Submitting for integration

            Show
            poltawski Dan Poltawski added a comment - Thanks Charles, sorry I didn't see this quicker. Submitting for integration
            Hide
            stronk7 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
            stronk7 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
            nebgor Aparup Banerjee added a comment -

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

            Show
            nebgor Aparup Banerjee added a comment - Thanks, the patch has been integrated into 21, 22 and master for testing.
            Hide
            abgreeve 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
            abgreeve 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
            stronk7 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
            stronk7 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:
                  Fix Release Date:
                  9/Jul/12