Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-36303

Event links in calendar block have HTML special entities

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide
      1. Add two events to calendar
      2. On calendar block, make sure both events are visible.
      3. Click on event and make sure you are redirected to proper event and link should not contain

        &

      Show
      Add two events to calendar On calendar block, make sure both events are visible. Click on event and make sure you are redirected to proper event and link should not contain &
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
      wip-mdl-36303

      Description

      While adding Aria attributes we used html_writer which converts & to & for event links.

      calendar/lib.php - Line 359 should be reverted back from

      $cell = html_writer::link((string)$dayhref, $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));

      to

      $cell = '<a href="'.(string)$dayhref.'" '.$popupid.' aria-controls="'.$popupid.'_panel" id="'.$popupid.'">'.$day.'</a>';

      Steps to reproduce:

      1. Add two events to calendar
      2. On the calendar block, make sure both events are visible.
      3. Click on event and make sure you are redirected to proper event and link should not contain &amp;

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Increasing priority, as this is broken functionality.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Increasing priority, as this is broken functionality.
            Hide
            fred Frédéric Massart added a comment -

            Hi Raj,

            thanks for working on this. Just a minor comment, I think you don't have to output the moodle_url at all, as long as it is not casted as a string when passed to html_writer::link() is should be handled and escaped properly.

            Also, I found a regression causing the popup in the calendar not to be shown any more. Caused by MDL-16660 4c349ad7. I will raise an issue for that.

            Thanks!

            Show
            fred Frédéric Massart added a comment - Hi Raj, thanks for working on this. Just a minor comment, I think you don't have to output the moodle_url at all, as long as it is not casted as a string when passed to html_writer::link() is should be handled and escaped properly. Also, I found a regression causing the popup in the calendar not to be shown any more. Caused by MDL-16660 4c349ad7. I will raise an issue for that. Thanks!
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Thanks for spotting that Fred,

            I have fixed this and pushing for integration now

            Show
            rajeshtaneja Rajesh Taneja added a comment - Thanks for spotting that Fred, I have fixed this and pushing for integration now
            Hide
            poltawski Dan Poltawski added a comment -

            Hi Raj, does this need to be backported?

            Show
            poltawski Dan Poltawski added a comment - Hi Raj, does this need to be backported?
            Hide
            rajeshtaneja Rajesh Taneja added a comment -
            Show
            rajeshtaneja Rajesh Taneja added a comment - No Dan, regression was introduced on master only. http://git.moodle.org/gw?p=moodle.git;a=commitdiff;h=7df3ea154f025e49adc2fcb413434aab597a0ad6#patch1
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks Raj, i've integrated this now.

            Show
            poltawski Dan Poltawski added a comment - Thanks Raj, i've integrated this now.
            Hide
            phalacee Jason Fowler added a comment -

            works fine Raj

            Show
            phalacee Jason Fowler added a comment - works fine Raj
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Amazed. Inspired. Grateful. That’s how your generosity makes me feel.

            (not really)

            Closing, thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Amazed. Inspired. Grateful. That’s how your generosity makes me feel. (not really) Closing, thanks!

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/12