Running Acquia DevDesktop under a different user account

So I recently found, due to corporate IT policy, my local admin/elevated privileges had been removed, and therefore I was unable to run Acquia Dev Desktop.

After having corporate IT support enter their administrative credentials, i found my local Drupal site was displaying the “Install Drupal” screen, rather than my local website. This screen is usually displayed when the local database is empty, but after checking my PHPMyAdmin, i could see this was not the case.

Maybe the new username account used to launch Dev Desktop didnt have permission to access the database, or could even see it? Correct, here’s my solution:

I copied this file:

C:\Users\My_Username\.acquia\DevDesktop\DrupalSettings\loc_[sitename]_dd.inc

…to the folder for the new user who has permission to launch DevDesktop:

C:\Users\New_User\.acquia\DevDesktop\DrupalSettings\loc_[sitename]_dd.inc

(The above folder was previously empty)

And, BOOM, now the local Drupal site runs successfully.

 

Published
Categorized as Drupal

Drupal and CKEditor, setting default values in the image properties dialog

Copy this file to the root of your theme directory:

/sites/all/modules/ckeditor/ckeditor.config.js

Edit the file and add the following code which will give a default value to HSpace, VSpace and ensure Bootstrap’s “img-responsive” class will be added to all images:

CKEDITOR.on( 'dialogDefinition', function( ev )
  {
    var dialogName = ev.data.name;
    var dialogDefinition = ev.data.definition;
 
    if ( dialogName == 'image' )
    {
      //set the margins
      var infoTab = dialogDefinition.getContents( 'info' );
      var hspaceField = infoTab.get( 'txtHSpace' );
      var vspaceField = infoTab.get( 'txtVSpace' );
      hspaceField['default'] = '10';     
      vspaceField['default'] = '10';

      //set the default class for images
      var advTab = dialogDefinition.getContents( 'advanced' );
      var stylesheetClassesField = advTab.get( 'txtGenClass' );
      stylesheetClassesField['default'] = 'img-responsive';
    }
  });

Lastly, edit your CKEditor profiles and set “Load ckeditor.config.js from theme path” to “Yes”:

/admin/config/content/ckeditor/edit/Advanced

Done.

Acquia Dev Desktop – Sharing your local site

If you’re developing a Drupal site locally, using Acquia Dev Desktop 2, and you need to allow your co-workers to see it, you’ll need to make the following change to your vhosts.conf (located in devdesktop\apache\conf\vhosts.conf)

<VirtualHost *:8443>
  ServerName test.dev.dd
  SSLEngine on
  DocumentRoot "/Users/test/Sites/devdesktop/test-dev/docroot"
  <IfModule fcgid_module>
    FcgidInitialEnv PHPRC "/Applications/DevDesktop/php5_5/bin"
    FcgidWrapper "\"/Applications/DevDesktop/php5_5/bin/php-cgi\""
  </IfModule>
  <Directory "/Users/test/Sites/devdesktop/test-dev/docroot">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

Replace “Require local” with “Require all granted”, then stop and restart Apache/MySQL from within Dev Desktop.

 

Published
Categorized as Drupal

Drupal Block Region in Node Template

If you want to display a block region in a specific node template, simply add the following:

<?php
$myregion = block_get_blocks_by_region('myregion');
print render($myregion);
?>

 

Published
Categorized as Drupal

Talking about Agile/Scrum/Kanban

Today I made a small presentation to my co-workers in the marketing team about Agile, Scrum and Kanban. I discussed the history, how it works, and how we could utilize it.

Published
Categorized as Agile, Scrum

New Apartment Checklist

Things to check and look out for when moving to a new apartment:

  • Check the water pressure on cold, on hot, on both, and how long it takes to get warm, shower and bath too.
  • Check if you fit under the showerhead!
  • Find out who does the maintenance (some handyman, a legit company, the landlord?). What are their policies on work orders? Can they be submitted online? What is their response time guarantee for after hours emergencies? If it’s just a single landlord and not a property management company, do they have someone you can call when they go on vacation and the hot water heater breaks?
  • Go to the property at night and see what the noise is like
  • How much notice the landlord has to give before showing up
  • Inspect tops of cabinets, behind stove/fridge, for poop. If there are red/brown stains in the corners where the ceiling meets the walls, it’s bed bugs. If there is a line of white powder along the baseboards, it can mean roaches, but more likely bedbug treatment has been performed. White powder behind fridge, stove, etc. is usually boric acid or diatomaceous earth used to treat roaches. Brown or tan kernel sized paste is also used against roaches. Check the Bed Bug Registry online and ask if the building has a history of any pest problems.
  • Signal on your phone
  • Learn about the community by looking at how the treat the dumpster area
  • Research state tenant’s rights laws
  • Make sure you’re completely clear on all terms of the lease and know what utilities you’ll be paying and what payment method you’ll need to use.
  • Make sure there’s an Internet provider suitable to your preferences.
  • Google your potential new landlord. Look up online property records in the county you are in. Slumlords will generally have lots of liens against them and/or have multiple properties in foreclosure.
  • Assure the windows are double-paned/double-glazed and in good repair if the area is cold to avoid high heating bills. See if the windows open and close easily.
  • Be wary of any musty smells that could indicate water damage. Too many air fresheners may be an attempt to hide this.
  • Fill all sinks/tubs. Drain simultaneously and flush each toilet during.
  • Check your responsibilities as a tenant. After moving in many landlords require you to pay the cost of a stopped up toilet, pest infestations, and require you to shovel snow from sidewalk/mow the grass on areas around the house, or clean gutters. They may also require you to pay the cost to fix supplied appliances.
  • If surrounding places have belongings left sitting on the porches (toys, stoves, seating, decorations), it’s a good sign for little/no theft and a kid-friendly environment.
  • If the leasing agent or landlord promises to do something before you move in, it needs to be written into the lease or it may not happen.
  • 1st floor apartments are most convenient for thieves, and the most frequently broken into.
  • If there’s a homeowner’s association, find out its rules.
  • Find out the policy on smoking, pets, noise, and visitors.
  • If you must break the lease, what are the consequences/options?
  • What’s the average rental time for apartments in the building? If people aren’t staying long, it’s a bad sign.
  • Count the number of outlets in each room
  • Is there a recycling dumpster?
  • Ask where the circuit breaker is and if you can look at it. This is an important thing for you to know about in the event of a power surge or tripping a breaker. When you open the breaker box, just make sure it isn’t completely filthy and it looks like everything is capped and has functioning switches. Ask which ones are for your apartment if you have a shared breaker.
  • Ask how the unit is heated and cooled during the appropriate seasons. If it is a gas heating unit, your apartment will dry out a little more than a fully electrical one so you’ll want to have a humidifier. Ask the last time the system was serviced and make sure that you have a carbon monoxide / gas detector. If you will be using window AC units, be sure they can be removed during the winter and that, when in the window, they get sun during part of the day. If not, they will fail to dry out properly and can collect mold.
  • Smoking: If you are a nonsmoker you’re going to want to be sure your apartment has either never had a smoker in it or has been properly cleaned since an indoors smoker lived there. If a long-term resident also smoked indoors, the smell will have permeated in to the walls, carpet, and even the cabinets depending on how long they lived there and how heavy they smoked. Make sure the carpets have been professionally cleaned and open cabinets and closets and sniff for smoke smells. If you smell them, minor cases of bad smoke smells can be fixed with a new coat of paint and steam cleaning the carpet. Is the building “smoke free”?
  • check that there aren’t a million petty signs up in the lobby telling you what you can’t do – trash, noise, parking etc. It’s a giveaway that your neighbors are gonna be a problem.
  • Check out what the heat source is (if you live in a place with cold winters)
  • Make sure the windows are double pane. You lose tons of heat from windows as it is and single pane is only going to make it worse
  • Escape route in the event of a fire.
  • Check that the elevator works
  • Is the deposit refundable? Are there any nonrefundable deposits relevant to you?
  • What methods can I use to pay my bill?
  • Can you paint/hang pictures, and if so, what are the expectations on move-out?
Published
Categorized as Apartments

How to use the preheader personalization string in Exact Target

If you want to use a preheader in your Exact Target email send (you should), then you’ll attempt to implement the %%_PreHeader%% personalization string listed in their documentation, only to discover it’s inclusion prevents you from doing a “test send” or a “send preview”.

The solution is the following AMPScript, place this in your template:

%%=v(@Preheader)=%%

And this in your email properties:

%%[ 
VAR @Preheader 
SET @Preheader = "This is my preheader text" 
]%%

Note, just like your unsubscribe and web version links, this preheader will not be rendered in a test send, but it will render in a send preview, and of course a real send.

 

Using Drupal Rules Scheduler to Unpublish a Node

I use the Rules module together with Rules Scheduler (a Rules sub-module) to automatically unpublish content at a specified time, as explained in the steps below. These steps use content type = article, which has an expiry date field which is set by the user. When cron runs, the expiry date field is checked and the content is unpublished.

Step 1: Create a Rules “Component”

Here is the Rules Component to be created (in Rules export format):

{ "rules_unpublish_a_node" : {
    "LABEL" : "Unpublish an Article",
    "PLUGIN" : "action set",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "USES VARIABLES" : { "node" : { "label" : "node", "type" : "node" } },
    "ACTION SET" : [ { "node_unpublish" : { "node" : [ "node" ] } } ]
  }
}

 

Step 2: Create a “Rule” using the Rules Component

Here is the Rule to be created, in Rules export format:

{ "rules_unpublish_article" : {
    "LABEL" : "Unpublish Article",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "rules_scheduler" ],
    "ON" : {
      "node_insert" : [],
      "node_update--article" : { "bundle" : "article" }
    },
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "article" : "article" } }
        }
      }
    ],
    "DO" : [
      { "schedule" : {
          "component" : "rules_unpublish_a_node",
          "date" : [ "node:field-expiry-date" ],
          "identifier" : "Unpublish Article with node ID [node:nid]",
          "param_node" : [ "node" ]
        }
      }
    ]
  }
}

Note that the above rule refers to the Rules Component from the previous step. It’s in Rules export format, just import it in your own environment via copy-paste (after you adapted article in it to fit the machine name of your content type).

Published
Categorized as Drupal

On Agile/Scrum

At my previous employer, the agile/scrum process sometimes felt like this…

At my current employer, the web development team consists of… just me. So the above animation is especially true.

Published
Categorized as Agile, Scrum