Category Archives: Drupal

The aegir logo, a wave with the word aegir to the right of the wave.

Aegir site migration failure and success – say it ain’t so!

When using Aegir to upgrade production websites I follow a method very similar to the one outlined by Omege8cc – Safe Workflow

The safe workflow technique is nice as it lets you migrate sites into production without having to bring your live site down to basically test the migration. Occasionally, during the test migration Aegir reports that the migration has failed. However, if I look at my files it has successfully moved the entire site to the new platform but could not delete the settings.php file from the old platform and site. The important thing to check is that everything is now actually on your intended platform and is properly setup, vhost files, files dir, settings.php, etc…

If everything is peachy, Aegir did everything besides deleting the old settings.php file correctly. So, to clean up your Aegir interface you first want to delete the site that failed not using the delete button but by clicking the edit tab on the site and then in the URL changing the word edit to delete, and press enter. Confirm the deletion of the site.

Then on the server, delete the remaining old files off of the original platform. On the new platform navigate to your recently migrated site and change the file permissions on settings.php to 664. When you do your final migration Aegir will set the permissions back to the proper settings.

Next, go to the platform you migrated your site onto and verify the platform. Aegir will pick up the site, import it and you will be ready to finish your migrations.

A screen capture of the WWU WebTech BLog

A blog to follow

Hi all,

My colleagues and I have begun a blog about our day-to-day web work with Drupal, HTML/CSS/JS, git, SASS, and content wrangling. I will be writing on that blog as well. Here is my first post.

Currently this is a trial to make sure we can follow through with quality content. Please leave comments and if there is anything you want specific coverage on let us know at the WWU WebTech Blog or here.

In addition, in a continual effort to work towards embracing Responsive Web Design (RWD) I composed this post on a large flat screen TV. My neck is a little sore as it is a bit like sitting in the front row of a movie theater. Perhaps I need to get a Chromecast.


A water bottle sitting on top of a red bag.

PNWDS 2013 – Vancouver

The 2013 Drupal Summit was a great event. This was my third such summit and it was another solid Drupal event. I wanted to list the key ideas I took away from the conference as well as some modules and software that I am unfamiliar with but heard about over the two days.

Key Ideas

  1. Testing is becoming a major part of the Drupal development process.
    • This is awesome! There were fantastic sessions on PHPUnit and several on Behat. It is certainly a positive direction. There is no requirement to write tests but there is tremendous upside if you are creating reusable components, building from an install profile, or have mission critical components. Testing has been around for a long time with SimpleTest and other methodologies. However, there seemed to be a big focus on it at the summit.
    • PHP Unit Testing,Behat & Drupal
  2. Treat your site, service, component, etc… as a product.
    • I really enjoyed this concept. It appeared in several sessions as an underlying theme. The main concept is that whatever you are building, try hard to make it as if it was a standalone product. It should obviously work well, but how is the UI, is there documentation, tests, versions, etc… If we try for the above with each project or anything we are developing the finished piece should be better overall.
    • Enterprise Drupal, Delivering Amazing Support, Reusable Components

Modules and other software

ckeditor 4.1 & 4.2 sets inline styles for image width and height – One fix

ckeditor in their migration to the ACF system in 4.1 has forced by default image width and height into the images as inline styles.

Simply turning off ACF does not solve the problem. The ACF configuration can be set to send width and height to HTML attributes if you use ACF. The issue though is that they do not provide a “whitelist” of all the plugins. Without such a thing certain ckeditor toolbars will not appear, even when enabled in the editor configuration screen. Those issues are covered in the existing ACF issue and the media markup being converted to false issue.

After trying several solutions all to no avail I have resorted to using jQuery to resolve this dilemma.

Drupal.behaviors.imgAttributes = {
 attach: function () {
//First check to see if an image is on the page, if not, do nothing
 if ( $( 'img').length > 0 ) {
 //Loop through each image found and retrieve the width and height.
 //Then remove the width and height from the inline css.
 //Finally write the width and height as attributes to the html img tag.
   var imgWidth = $(this).css( "width");
   var removeWidth = $(this).css( "width", "" );
   var imgHeight = $(this).css( "height" );
   var removeHeight = $(this).css( "height", "");
 $(this).attr("height", imgHeight);
 //The figure wraps our images and if a height is set, it will not wrap
 //around the text, only the image. This is basically height:auto.
   var removeFigureHeight = $(this).css( "height", "");

Certainly this is not an elegant solution. However, modifying the ckeditor library itself seems risky for upgrade compatibility and ACF currently has no way to override the default “automatic” handling of ACF without declaring each and every component we use, which I tried, but couldn’t quite get to work in a satisfactory manner.

There is the following ckeditor bug ticket which has been again closed because ACF does allow you, as stated above, have image with and height be attributes not inline styles. However, getting ACF to work in Drupal with our myriad of other filters makes for a very challenging task.

While I do not feel this is a bug with WYSIWYG it is an annoyance for those using ckeditor and trying to create flexible images.