ARC-IM's blog

Adding LTER site field to biblio bibtex output and fixing thesis export

In preparing a bibtex export of publications for the 40th LTER anniversity review the export needs to include in the keywords - LTER-XXX, where XXX=  three-letter site acronym.

UPDATE #2:

So now we are not adding the ltersite field but we will need to add LTER-XXX as a keyword.  So a simple wayis to:

Using Display Suite to add a link to a field.

The DOI field in Data Set content is a text field not a link field type.  With Dispaly Suite Fields one can add a code field that will linked the DOI to doi.org.

The trick here is to use tokens to display the DOI and to link to.

So: Administration -> Structure -> Display Suite-> Fields and Add a code field. 

Give it a  Label and check Entities-> Node and at the bottom check Tokens

The token for the DOI field is: [node:field_doi].  You can browse the available tokens to find all the available tokens.

Disabling the increase of revision number when a data set is saved.

  • The update of the revision number when data sets are saved was not useful since the number can get out of hand when doing multiple saves.  In the eml module the "drupal_root"/profiles/deims/modules/custom/eml/lib/EmlDataSet.php has a funtion to update the revision.  I modified as such: (Note that below code uses the a patch file - and + notations.)

   public function incrementEMLRevisionID() {
     $revision_id = $this->getEMLRevisionID();
-    if (!empty($revision_id)) {
-      $revision_id++;
-    }

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

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.)

Pages

Subscribe to RSS - ARC-IM's blog