Tag Archives: patches

Moodle Drag Drop features does not work in IE9 fix

We recently encountered some IE9 incompatibility issues with our latest Moodle 2.1+ installation. It turns out that the used version of the graphical back-end Yui seems do have some problems with IE9 ,…. or the other way round :-).

There are couple of bug request in the moodle bug tracking system, but for 2.1+ there is unfortunately no commit in master which fixes this issue.

So if you do not want to wait for an official release take a look at -> link. Follow the walkthrough how to update Yui an this should fix the IE9 problems.

have fun

Moodle 2.0 Attendance module fix for use with PostgreSQL

Here you will find a small fix for the attendance module for moodle 2.0. Some queries have problems if the are executed on our PostgreSQL database. So if you get some “group by” errors you could use the following fix. For the module see here
Change query @row 826

1SELECT ue.userid, ue.status, ue.timestart, ue.timeend
2                      FROM {user_enrolments} ue
3                      JOIN {enrol} e ON e.id = ue.enrolid
4                     WHERE ue.userid $usql
5                           AND e.status = :estatus
6                           AND e.courseid = :courseid
7                  GROUP BY ue.userid, ue.status, ue.timestart,ue.timeend

and @row 851

1SELECT ue.userid, ue.status, ue.timestart, ue.timeend
2                  FROM {user_enrolments} ue
3                  JOIN {enrol} e ON e.id = ue.enrolid
4                 WHERE ue.userid = :uid
5                       AND e.status = :estatus
6                       AND e.courseid = :courseid
7              GROUP BY ue.userid,ue.status, ue.timestart, ue.timeend

have fun

Trac, Watchlist plugin support for trac 0.12 microsecond feature

This is a patch for getting the WatchPlugin working with trac 0.12.

01+++ ./plugin.py    Sat Apr 03 16:56:17 2010
02@@ -26,6 +26,7 @@
03 
04 from  trac.env         import  IEnvironmentSetupParticipant
05 from  trac.util        import  format_datetime, pretty_timedelta
06+from trac.util.datefmt import  from_utimestamp, to_utimestamp
07 from  trac.web.chrome  import  INavigationContributor
08 from  trac.web.api     import  IRequestFilter, IRequestHandler, RequestDone
09 from  trac.web.chrome  import  ITemplateProvider, add_ctxtnav, add_link, add_script, add_notice
10@@ -38,6 +39,7 @@
11 from  trac.wiki.model  import  WikiPage
12 from  trac.ticket.model import Ticket
13 
14+
15 __DB_VERSION__ = 3
16 
17 class WatchlistError(TracError):
18@@ -347,9 +349,9 @@
19 'name' : name,
20 'author' : author,
21 'version' : version,
22-                        'datetime' : format_datetime( time ),
23-                        'timedelta' : pretty_timedelta( time ),
24-                        'timeline_link' : timeline_link( time ),
25+                        'datetime' : from_utimestamp( time ),
26+                        'timedelta' : pretty_timedelta( from_utimestamp(time) ),
27+                        'timeline_link' : timeline_link( from_utimestamp(time) ),
28 'comment' : comment,
29 'notify'  : notify,
30 })
31@@ -426,9 +428,9 @@
32 'author' : author,
33 'commentnum': to_unicode(self.commentnum),
34 'comment' : len(self.comment) <= 250 and self.comment or self.comment[:250] + '...',
35-                        'datetime' : format_datetime( changetime ),
36-                        'timedelta' : pretty_timedelta( changetime ),
37-                        'timeline_link' : timeline_link( changetime ),
38+                        'datetime' : from_utimestamp( changetime ),
39+                        'timedelta' : pretty_timedelta( from_utimestamp( changetime ) ),
40+                        'timeline_link' : timeline_link( from_utimestamp( changetime ) ),
41 'changes' : changes,
42 'summary' : summary,
43 'notify'  : notify,

This patch applies to rev 7710, you can download the patch from trac-Hacks

Have fun 🙂