Notes To Self

As time goes on it's harder to look back and remember how I solved the little glitches that eat up so much time. The idea here is a one stop area to jog my memory on these little problems that can turn out to be big if you have to research them all over again.

Problems After Update to PHP 5.4.19

Had to disable GA Tokenizer module after PHP update. Critical error and site was dead. I'll have to sort it out later, but got site up by disabiling the module in system table. Later the problem reoccured even with module dissabled. Updated to lates dev version of GA Tokenizer and problem seems to be solved.

Also two PECL related problems here at PcHousekeeping.  

Base URL in Drupal 7 settings.php

Added a StartSSL certificate today to a site and after all was done the style sheets wouldn't load when accessing with https. The culprit turned out to be having  <?php $base_url = 'http://www.example.com'; ?> set in settings.php.

Updating A Commerce Kickstart Site With Drush

Found some pitfalls in updating my Commerce Kickstart install with Drush 6 today. I did it as normal with "drush up drupal" and it crashed after deleting all the files and folders except the sites directory. Long story made short: 

  1. $ drush dl commerce_kickstart
  2. $ drush updatedb -y

Colorbox Gallery With Only One Image Showing On Node

Tricky set up to achieve Colorbox gallery like here. Most of the time you see multiple thumbnail images on the page and then clicking one shows a colorbox slideshow of larger images.

Weight For Sort Order

I wanted to change the sort order of the Notes to Self so I added the Weight module. I enabled it only for this one content type for now, and then added Weight to my Sort filters in the view that displays the page. 

Had to go back and enable the Weight module for Article and Page content types so they would show on front page. See the module README.

Syntax Highlighting For Code In Posts

Trying the GeSHi Filter for Drupal 7 to get pretty syntax colored code in posts like:

  1. <?php
  2. $query = new EntityFieldQuery();
  3.  
  4. $query->entityCondition('entity_type', 'node')
  5. ->entityCondition('bundle', 'article')
  6. ->propertyCondition('status', 1)
  7. ->fieldCondition('field_news_types', 'value', 'spotlight', '=')
  8. ->fieldCondition('field_photo', 'fid', 'NULL', '!=')
  9. ->fieldCondition('field_faculty_tag', 'tid', $value)
  10. ->fieldCondition('field_news_publishdate', 'value', $year. '%', 'like')
  11. ->fieldOrderBy('field_photo', 'fid', 'DESC')
  12. ->range(0, 10)
  13. ->addMetaData('account', user_load(1)); // Run the query as user 1.
  14.  
  15. $result = $query->execute();
  16.  
  17. if (isset($result['node'])) {
  18. $news_items_nids = array_keys($result['node']);
  19. $news_items = entity_load('node', $news_items_nids);
  20. }
  21. ?>

Drupal 6 to Drupal 7 Profile Migration

Working on the Raintree Village upgrade to Drupal 7 and came on the problem of migrating D6 Content Profile module profiles to D7 Profile2.

We are trying to move profile data from Drupal 6 nodes that are content types to Drupal 7 data in entities. There is no direct upgrade path so thanks to the insperation gathered here I was able to use VBO to move the data.

Pages