Moodle

Popup for calendar event doesn't display

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6, 1.6.1, 1.6.2, 1.7
  • Fix Version/s: 1.6.2, 1.7
  • Component/s: Calendar
  • Labels:
    None
  • Affected Branches:
    MOODLE_16_STABLE, MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_16_STABLE, MOODLE_17_STABLE

Description

Steps to reproduce:

1) Open your Moodle
2) Set your browser language to fr_utf8 (Français)
3) If there is no event for today in your calendar, add one
4) Display the calendar
5) The browser doens't display the popup for today's events. Popups for other events are not affected.

The problem is that in french the string for "Today" contains an apostrophe: $string['today'] = 'Aujourd\'hui'; that causes a Javascript error "missing ) after argument list".

Activity

Hide
Nicolas Martignoni added a comment -

Suggested fix in calendar/lib.php,v 1.142.2.3:

@@ -338,6 +338,7 @@
$popupcaption .= get_string('eventsfor', 'calendar', userdate($event_timestart, get_string('strftimedayshort')));
}
$popupcontent = str_replace("'", "\'", htmlspecialchars($popupcontent));
+ $popupcaption = str_replace("'", "\'", htmlspecialchars($popupcaption));
$popup = 'onmouseover="return overlib(\''.$popupcontent.'\', CAPTION, \''.$popupcaption.'\');" onmouseout="return nd();"';
return $popup;
}

Show
Nicolas Martignoni added a comment - Suggested fix in calendar/lib.php,v 1.142.2.3: @@ -338,6 +338,7 @@ $popupcaption .= get_string('eventsfor', 'calendar', userdate($event_timestart, get_string('strftimedayshort'))); } $popupcontent = str_replace("'", "\'", htmlspecialchars($popupcontent)); + $popupcaption = str_replace("'", "\'", htmlspecialchars($popupcaption)); $popup = 'onmouseover="return overlib(\''.$popupcontent.'\', CAPTION, \''.$popupcaption.'\');" onmouseout="return nd();"'; return $popup; }
Hide
Vy-Shane Sin Fat added a comment -

Fixed. Thanks for the patch.

Show
Vy-Shane Sin Fat added a comment - Fixed. Thanks for the patch.
Hide
Nicolas Martignoni added a comment -

Verified, closing.

Show
Nicolas Martignoni added a comment - Verified, closing.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: