Browse Source

Fixed a bug where inserting an analysis will fail if the postgres datestyle setting is not MDY.

spficklin 14 years ago
parent
commit
71e8d6c55a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tripal_core/tripal_core.module

+ 5 - 0
tripal_core/tripal_core.module

@@ -57,6 +57,11 @@ function tripal_core_init(){
       var baseurl = '$base_url'; 
       var themedir = '$theme_dir'; 
       var isClean = $clean_urls;",'inline');
+
+   // make sure the date time settings are the way Tripal will insert them
+   // otherwise PostgreSQL version that may have a different datestyle setting
+   // will fail when inserting or updating a date column in a table.
+   db_query("SET DATESTYLE TO '%s'",'MDY');
 }