CMS MADE SIMPLE FORGE

LISE

 

[#11012] Issue with DateTime fields after upgrading from 1.1 to 1.2.1.1

avatar
Created By: Eduardo Martinez (hexdj)
Date Submitted: Wed May 04 17:27:57 -0400 2016

Assigned To:
Version: 1.2.1.1
CMSMS Version: 1.12
Severity: Major
Resolution: None
State: Open
Summary:
Issue with DateTime fields after upgrading from 1.1 to 1.2.1.1
Detailed Description:
If you upgrade from 1.1 to 1.2.1.1 and in your instance you had already a
Date/Time field, you will get an error when you try to go to your LISE Instace
with said field.

You have to make sure that "backwards compatibility" is checked for all
date-time fields before upgrading otherwise you won't be able to access your
LISE instance settings and/or data.

But there is a work around if you upgraded and you're stuck in that error.

Go to this file:
modules/LISE/lib/class.lise_datetime_utils.php

Remove the double quotes in line 70, it should look like this after you do:
$datetime = new DateTime(@$value);

Go back to CMS Admin and access your LISE instance that was puking the error, go
to every date/time field and make sure "backwards compatibility" is checked.

Go back to the same file and edit it back to what it was originally:
$datetime = new DateTime("@$value");

It's not ideal but a work around after you have come across this error and can't
access your data/settings in your LISE  instances that use date/time fields.

 


History

Comments
avatar
Date: 2016-05-04 17:32
Posted By: Eduardo Martinez (hexdj)

I should add that, this seems to be an issue only if you're displaying the
date/time field in the backend item list.
      
avatar
Date: 2016-05-06 22:29
Posted By: Jeff Bosch (ajprog)

Here is an UDT fix so that you don't need modify code. Replace **MODULE_NAME**
in first line with your LISE Instance name.

----------------------------------
$mod = cmsms()->GetModuleInstance('**MODULE_NAME**');
$fielddefs = $mod->GetFieldDefs();
foreach($fielddefs as $fielddef) {
  if( $fielddef->GetType() == "SelectDateTime" ) {
    $fielddef->SetOptionValue('backwards_compatibility', TRUE);
    LISEFielddefOperations::Save($mod, $fielddef);
  }
}
      
avatar
Date: 2016-10-23 19:38
Posted By: Jos (josvd)

Thanks for the UDT Jeff. That fixed it like a charm
      
Updates

Updated: 2016-05-04 17:32
resolution_id: => 5