Moodle
  1. Moodle
  2. MDL-36303

Event links in calendar block have HTML special entities

    Details

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

      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;

        Issue Links

          Activity

          Hide
          Rajesh Taneja added a comment -

          Increasing priority, as this is broken functionality.

          Show
          Rajesh Taneja added a comment - Increasing priority, as this is broken functionality.
          Hide
          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
          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
          Rajesh Taneja added a comment -

          Thanks for spotting that Fred,

          I have fixed this and pushing for integration now

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

          Hi Raj, does this need to be backported?

          Show
          Dan Poltawski added a comment - Hi Raj, does this need to be backported?
          Hide
          Rajesh Taneja added a comment -
          Show
          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
          Dan Poltawski added a comment -

          Thanks Raj, i've integrated this now.

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

          works fine Raj

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

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

          (not really)

          Closing, thanks!

          Show
          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: