19th September 2013

Coder Lounge - September 2013

John Ennew
Technical Director

Converting Session Limit to Drupal 8

This week we began the work of converting the session limit module to Drupal 8. Following webchicks instructions for converting modules (based on the example pants module) the info file was converted to YML and the tests were made to run (and they all fail - excellent, time for some TDD). Next we got the configuration into the configuration management from the variable table by creating the relevant schema files. There are two of them - one for schema description for each variable which describes its type and one for default values for the variables. This felt a little messy and the YML was quite verbose - but maybe just needs some getting used to. Next the admin settings form was replaced from the formapi functions we us, the pants module seems to be a little out of date from D8 reality at the moment and we had to resort to investigating the core 'book' module to understand how to make a settings form. We like this, the new formapi style is quite clean as all the forms a module provides get stored in a Forms folder with one class file for each form. Disaapointed to see form_set_error is still procedural though - wondering if this is work in progress? This was as far as we got - stay tuned for what happened next!

Contrib

Dan continued some work on getting pretty stack traces into devel and Drupal 7 using integration with xdebug - follow along with the progress here: xdebug_print_function_stack

Core contributions

Pete and Anni, our crack core contributors, made some progress on the following issues and joined in the discussions on a number of others awaiting some extra work: