Blogs

Re-populating the cache_lter_unit table

Somehow the cache for lter_ units in my site was empty.  In looking at the MySQL database units-option:en and units:scope=2 were empty arrays.  This cache is created from the deims custom module lter_unit. Specifically in the lib/LterUnitHelper.php

This a drupal_static(__FUNCTION__) .  There is not a way for the cache to expire and get reloaded.  I add the following code to check if the cache data is empty and reload the database if it is.

      $cache = cache_get($cid, 'cache_lter_unit');
      if (!empty($cache->data)

Invalid date range upon saving content

I was getting an error when saving a Data Source Content type with a large number of variables.  Date invalid fromat.

In syslog there was a message: apache2: PHP Warning:  Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. 

After seaarching I found: https://2bits.com/drupal/drupal-not-saving-admin-pages-large-number-inpu...

Configuring PHP to accept more input variables

Feeds import and php 7

I was getting and error using a feed import of a csv file.  In syslog there was :Fatal error: Redefinition of parameter $source in /Users/daniel/sites/myproject/wwwroot/sites/all/modules/contrib/feeds_tamper/plugins/default_value.inc

I was getting this error even though I was not using a tamper.

Did a search and found it was fixed in the latest dev file. 

Adding File hash and number of records to DEMIS EML

Number of Records

A field for Number of Records for a comma delimited data file was not included in the DEIMS 7.  I added it to the Data Source content type as an integer  with a name of 'Number of records' (machine name - field_number_of_records). (Side Note: I actually added the hash output first. After staring at the code for so long I decided to add this also.)

Adding css scroll bars to a view

After searching the internet for a way to add scroll bars to a block view in Drupal 7 it turns out to be rather simple.

Under advanced settings in veiws there is setting for CSS class.  So I added a class to div in my custom css file for my theme.  See https://www.drupal.org/docs/7/theming/working-with-css for more details about css in drupal 7.

The following classes were added:

Using rsync to copy production to dev

rysnc from production to local

To copy the contents of the remote directory into a directory in your local, See note below about trailing '/':

sudo rsync -chavzP --stats --delete --exclude sites/default/settings.php user@remote.host:/path/to/copy/  /path/to/local/storage   (see http://stackoverflow.com/questions/9090817/copying-files-using-rsync-fro...)

6 to 7 migration notes from my email

Changes:

Before migrate

php tidy needs to installed. Use:

    sudo apt-get install php5-tidy otherwise one gets an error about missing  ';'  which is because and '&' was passed and not a '&amp'

Need to give the drupal 6 user permission on the drupal 7 database. 

Need to increase file upload time: Was getting "Fatal error: "Maximum execution time of 240 seconds exceeded"

Pages

Subscribe to RSS - blogs