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
SELECT ue.userid, ue.status, ue.timestart, ue.timeend
                      FROM {user_enrolments} ue
                      JOIN {enrol} e ON e.id = ue.enrolid
                     WHERE ue.userid $usql
                           AND e.status = :estatus
                           AND e.courseid = :courseid
                  GROUP BY ue.userid, ue.status, ue.timestart,ue.timeend

and @row 851

SELECT ue.userid, ue.status, ue.timestart, ue.timeend
                  FROM {user_enrolments} ue
                  JOIN {enrol} e ON e.id = ue.enrolid
                 WHERE ue.userid = :uid
                       AND e.status = :estatus
                       AND e.courseid = :courseid
              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.

+++ ./plugin.py    Sat Apr 03 16:56:17 2010
@@ -26,6 +26,7 @@

 from  trac.env         import  IEnvironmentSetupParticipant
 from  trac.util        import  format_datetime, pretty_timedelta
+from trac.util.datefmt import  from_utimestamp, to_utimestamp
 from  trac.web.chrome  import  INavigationContributor
 from  trac.web.api     import  IRequestFilter, IRequestHandler, RequestDone
 from  trac.web.chrome  import  ITemplateProvider, add_ctxtnav, add_link, add_script, add_notice
@@ -38,6 +39,7 @@
 from  trac.wiki.model  import  WikiPage
 from  trac.ticket.model import Ticket

+
 __DB_VERSION__ = 3

 class WatchlistError(TracError):
@@ -347,9 +349,9 @@
 'name' : name,
 'author' : author,
 'version' : version,
-                        'datetime' : format_datetime( time ),
-                        'timedelta' : pretty_timedelta( time ),
-                        'timeline_link' : timeline_link( time ),
+                        'datetime' : from_utimestamp( time ),
+                        'timedelta' : pretty_timedelta( from_utimestamp(time) ),
+                        'timeline_link' : timeline_link( from_utimestamp(time) ),
 'comment' : comment,
 'notify'  : notify,
 })
@@ -426,9 +428,9 @@
 'author' : author,
 'commentnum': to_unicode(self.commentnum),
 'comment' : len(self.comment) <= 250 and self.comment or self.comment[:250] + '...',
-                        'datetime' : format_datetime( changetime ),
-                        'timedelta' : pretty_timedelta( changetime ),
-                        'timeline_link' : timeline_link( changetime ),
+                        'datetime' : from_utimestamp( changetime ),
+                        'timedelta' : pretty_timedelta( from_utimestamp( changetime ) ),
+                        'timeline_link' : timeline_link( from_utimestamp( changetime ) ),
 'changes' : changes,
 'summary' : summary,
 'notify'  : notify,

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

Have fun 🙂