Latest Blog Posts

Revisions in Drupal 8

Submitted by Anonymous (not verified) on Mon, 07/09/2015 - 09:56

<p>I’m sorry to say that on the surface little has changed with revisions in Drupal 8, but there is some work still being done.</p><!-- more --><p>The first step, for me, is to get <a href="https://www.drupal.org/node/2490136&quot; target="_blank">revisions enabled by default</a>. I was interested to hear from <a href="https://www.drupal.org/u/webchick&quot; target="_blank">webchick</a> that this <a href="https://www.drupal.org/node/2490136#comment-10058018&quot; target="_blank">came up indirectly during user testing</a>. Most Drupal sites I have worked on have been large enterprise organisations. These types of companies all want an audit trail and all want to effectively manage their content. This is easily achievable by using revisions. It looks as though many new to Drupal are in a way scared by revisions. Enabling revisions by default will take away the reasoning for being scared and give this awesome feature out of the box.</p><p>The current revisions system isn’t perfect, it’s pretty good, but not perfect. There’s a lot of work being done to improve upon in. In Drupal 7 we had the <a href="https://www.drupal.org/project/deploy&quot; target="_blank">deploy module</a>, which allowed users to move content from one site to another, such as from staging to production, this built upon the existing revisioning platform. In Drupal 8 we have the <a href="https://drupal.org/project/multiversion&quot; target="_blank">multiversion</a> and <a href="https://drupal.org/project/relaxed&quot; target="_blank">relaxed web services</a> modules. These were both <a href="https://www.youtube.com/watch?v=UGW8sbgl26M&quot; target="_blank">demoed</a> by <a href="https://www.drupal.org/u/dixon_&quot; target="_blank">dixon_</a> at <a href="https://events.drupal.org/losangeles2015&quot; target="_blank">Drupalcon Los Angeles</a>.</p><p>Although <a href="https://drupal.org/project/multiversion&quot; target="_blank">multiversion</a> builds upon Drupal 8′s core revision system it’s vastly different with an awesome direction. One key feature is it enables revisions for every entity, users, comments, everything. The way it displays revisions as a tree also makes it clear and understandable as to how the revisons work and how the relate.</p><p>The <a href="https://drupal.org/project/relaxed&quot; target="_blank">relaxed web services</a> module builds upon a similar ethos as the <a href="https://www.drupal.org/project/deploy&quot; target="_blank">deploy module</a>, but it makes use of an API based on the <a href="http://www.replication.io/&quot; target="_blank">replicatio.io protocol</a> to handle bi-directional content replication. This means it can replicate content to any other <a href="http://www.replication.io/&quot; target="_blank">replicatio.io protocol</a> source such as <a href="http://couchdb.apache.org/&quot; target="_blank">couchdb</a> or <a href="http://pouchdb.com/&quot; target="_blank">pouchdb</a>.</p><p>Step by step Drupal 8 is getting more amazing.</p><p>To find out more about all this head along to the <a href="https://events.drupal.org/barcelona2015/sessions/planning-crap-and-revi…; target="_blank">Planning for CRAP and entity revisions everywhere in core</a> session at Drupalcon Barcelona on Tuesday 22nd September at 11am in room 122-123 “Interoute”.</p>

Update module the next generation

Submitted by Anonymous (not verified) on Wed, 02/09/2015 - 13:48

<p>In a post last week I discussed <a href="http://tim.millwoodonline.co.uk/post/127563720855/versioning-in-drupal&…; target="_blank">versioning in Drupal</a> and briefly touched on version numbers in info files. A lot of my focus over the last few months has been around composer and Drupal, one issue for Drupal when using composer for contrib modules is that the info file is pulled from git and therefore doesn’t have the version number, project name or datestamp in the info.yml file that is added by the drupal.org packager.</p><!-- more --><p>I am <a href="https://www.drupal.org/node/2559313&quot; target="_blank">currently working on a patch</a> for the update module which will get the project name from the module’s composer.json. This is just the first step because the project name is what’s needed for the module to show on the update status page.</p><p>The patch adds a composer parser service, which like the info parser service that parses the info.yml file of a module, this parses the composer.json file of a module. From here we can get the project name such as “drupal/devel”, then by exploding that we can get the project name from the second element in the array.</p><p>Composer.json files sometimes include a version number so we could use that too, but this is vary rare. The only real option for the version number is the git branch or git tag, this is how the <a href="https://www.drupal.org/project/git_deploy&quot; target="_blank">git deploy module</a> works.</p>

Versioning in Drupal

Submitted by Anonymous (not verified) on Tue, 25/08/2015 - 16:59

<p>Currently Drupal has <a href="https://www.drupal.org/node/1015226&quot; target="_blank">naming conventions</a> for branches and tags in git for contrib module. These are based on the core version then the module version, for example 7.x-1.x would create a dev version 1 for Drupal 7, 7.x-2.3 would create a stable release version 2.3 for Drupal 7.<br/></p><!-- more --><p>As we head towards Drupal 8 there has been a lot of talk about versioning for contrib. Core has already moved to using <a href="http://semver.org/&quot; target="_blank">semantic versioning</a> (semver), which is widely adopted by a lot of software now. Contrib is still on the old version numbering format. There is a <a href="https://www.drupal.org/node/1612910&quot; target="_blank">lot of discussion</a> about switching to something like semantic versioning for contrib. It’d be ideal to keep the core version somewhere in the number, there have been many suggestions, some of which are:</p><ul><li>2.3.0-d8<br/></li><li>2.3.0#d8</li><li>2.3.0@d8</li><li>d8.2.3.0</li><li>8.2.3.0</li></ul><p>My preferred, and it seems the favourite so far is 8.2.3.0, this is much like semver but the major version has been bumped down to make way for the core version, therefore core.major.minor.patch. The only possible issue here is if using composer for contib modules, composer will think the core version number is the major version number, and it will think the major version number is the minor version number. I feel that this is an ok compromise and we as developers can take this into account when using the syntax in composer.json.</p><p>Another versioning related issue is that we currently add the version number into the contrib info file as part of the packager that creates the module zip or tarball files. If more people pull modules straight from git (via composer) they won’t have this version number, causing the core update module not to work.</p><p>I say we should start asking module maintainers to add the version number to the info file. They already have to add the version number to the tag or branch, surely it’s no extra effort to add it to the info file, and saves so much effort trying to find a fancy programatic solution.</p><p><b>Update:</b><br/>As part of this I have opened <a href="https://www.drupal.org/node/2559313&quot; target="_blank">another issue on d.o</a> to discuss how we can make update module work for modules installed via git (including via composer).</p>