Developer meeting April 2015

Jump to: navigation, search

Developer meetings > April 2015 meeting notes

Time 07:00 UTC on Tuesday, 21 April 2015 Add to my calendar
Meeting room Live stream at YouTube
Forum discussion GDF thread
Chat Regular dev chat
Twitter #moodledev
Event page Google+ event page
Meeting notes Google doc

Agenda

The meeting focuses on changes in the upcoming Moodle 2.9 release with special attention paid to impact of these changes on community contributors and plugin authors.

Work in progress - individual items to be confirmed, the exact order is subject of change.

Per-request temp directories

To better support clustered Moodle environments, we have introduced a new per-request directory helper. This new helper creates a new directory which is automatically cleared away after use and should be used when a file is temporarily needed but does not need to be shared by other nodes in a cluster.

First experiences with mustache, the new template framework

To see how to work with the Moodle Mustache implementation I refactored the »clean« theme to a Mustache theme. The process went quite well. I'll try to show the main thoughts and steps in the refactoring process in about 10 minutes. We may have some time to talk about Moodle Mustache afterwards.

You may have a look at the theme »cleanm« in my Git repo.

Urs Hunkler (talk) 23:32, 13 April 2015 (AWST)

Unified AJAX script handler

In Moodle 2.9 we have added a new ajax script with the ability to call web service functions directly. There is also a convenient javascript module that is used to call these functions and return a structured response/error.

Some reasons why?

  • Implementing security for ajax scripts is not straight forward, and the more scripts we have, the more chance for security holes
  • All ajax scripts perform essentially the same duplicated logic (read params, check permissions, call something, format a response)
  • Encourages the design of consistent and complete external apis which then benefits both web services and Javascript

Some cool features of this ajax script / javascript module are:

  • Strict type checking of parameters and responses (as defined by the web service)
  • Web service functions must be "whitelisted" in order to be available to call from javascript
  • Has the ability to chain multiple requests into a single HTTP request

Timezones handling

Moodle 2.9 is switching to native PHP date and time code. The old homegrown DST switching routines were completely removed. Instead of downloading the timezone.txt file administrators need to keep their PHP timezone up-to-date. There are still some remaining date/time bugs throughout the codebase, but this change makes the fixing much easier because developers may finally use the DateTime class or legacy date functions in PHP.

Navigation improvements

A long term project to overhaul the navigation in Moodle has been underway for a long time now. Moodle 2.8 saw a new "user menu" but Moodle 2.9 makes many more changes which improve the user experience by creating consistent navigation and visual cues for all pages relating to "users".

More specifically:

  • Rename "My home" => "My dashboard" and made it the default home page.
  • New/redesigned pages for "My profile", "My preferences", "My grades"
  • New user header displayed on pages relating to a user
  • New course header / user sub header combination displayed on "Course pages relating to a user"
  • Reduce context jumps in/out of a course (for example: Ajax messaging popup)

How this affects plugin developers:

  • New API for my profile page
  • New preferences page is built from the nav tree
  • Use the proper context for each page (especially user context for user pages)
  • Put things in the correct place in the navigation tree

Behat tests runs in parallel

As we have over 33000 behat steps in moodle and it's growing rapidly. It takes around 12 hours to execute whole behat suite, which is not expectable for any testing environment. With initial work from Tony and Damyon, we came up with strategy of splitting feature files in different processes and run them in parallel. I will try cover options and demo for running behat in parallel.

More

  • If you have something you'd like to add to this page, please contact David Mudrák.