ERROR Double timezone specification op LISE view

Nederlandse ondersteuning voor CMS Made Simple

Moderator: velden

Post Reply
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

ERROR Double timezone specification op LISE view

Post by pedes »

Ik gebruik LISE met FEU beveiligde pagina.
Dit werkt, echter ik heb een lijst met wedstrijden in een LISE instance gemaakt in een beveiligde pagina (alle beveiliging staat correct ingesteld, met FEU, ect... als ik erop klik krijg ik een error.

Code: Select all

ERROR: at line 127 in file /home/ap3t/domains/mijnsite.be/public_html/modules/LISE/lib/class.lise_datetime_utils.php:
DateTime::__construct(): Failed to parse time string (@11-02-2017) at position 6 (-): Double timezone specification

FULL TRACE
#0 /home/ap3t/domains/mijnsite.be/public_html/modules/LISE/lib/class.lise_datetime_utils.php(127): DateTime->__construct('@11-02-2017')
#1 /home/ap3t/domains/mijnsite.be/public_html/modules/LISE/lib/fielddefs/SelectDateTime/liseeh.SelectDateTime.php(175): lise_datetime_utils::unix_ts_to_date('11-02-2017', 'd-m-Y')
#2 /home/ap3t/domains/mijnsite.be/public_html/modules/LISE/lib/class.LISEItemOperations.php(333): liseeh_SelectDateTime->OnItemLoad(Object(LISEWedstrijdOverzicht))
#3 /home/ap3t/domains/mijnsite.be/public_html/modules/LISE/framework/action.default.php(185): LISEItemOperations::Load(Object(LISEWedstrijdOverzicht), Object(LISEItem), Array)
#4 /home/ap3t/domains/mijnsite.be/public_html/modules/LISE/lib/class.LISEInstance.php(472): include('/home/ap3t/doma...')
#5 /home/ap3t/domains/mijnsite.be/public_html/lib/classes/class.CMSModule.php(1489): LISEInstance->DoAction('default', 'm1569c', Array, '45')
#6 /home/ap3t/domains/mijnsite.be/public_html/lib/module.functions.php(106): CMSModule->DoActionBase('default', 'm1569c', Array, '45', Object(CMS_Smarty_Template))
#7 /home/ap3t/domains/mijnsite.be/public_html/lib/classes/class.CMSModule.php(270): cms_module_plugin(Array, Object(CMS_Smarty_Template))
#8 /home/ap3t/domains/mijnsite.be/public_html/tmp/templates_c/45content_en^62e936251e4799749e89fa9828a0ee7332eb5816_0.content.content_en.php(25): CMSModule::function_plugin(Array, Object(CMS_Smarty_Template))
#9 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_template_resource_base.php(128): content_59b45238616250_03965781(Object(CMS_Smarty_Template))
#10 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_template_compiled.php(172): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(CMS_Smarty_Template))
#11 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_internal_template.php(206): Smarty_Template_Compiled->render(Object(CMS_Smarty_Template))
#12 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(216): Smarty_Internal_Template->render(false, 0)
#13 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(107): Smarty_Internal_TemplateBase->_execute('content:content...', 'p45|content_en', '45content_en', NULL, 0)
#14 /home/ap3t/domains/mijnsite.be/public_html/lib/classes/internal/class.CMS_Smarty_Template.php(20): Smarty_Internal_TemplateBase->fetch('content:content...', 'p45|content_en', '45content_en', NULL)
#15 /home/ap3t/domains/mijnsite.be/public_html/lib/classes/internal/class.CMS_Content_Block.php(316): CMS_Smarty_Template->fetch('content:content...', '|content_en', '45content_en')
#16 /home/ap3t/domains/mijnsite.be/public_html/tmp/templates_c/e47747a9d075f96463f3d893a106f66f740181e5_0.tpl_body.23.php(135): CMS_Content_Block::smarty_internal_fetch_contentblock(Array, Object(CMS_Smarty_Template))
#17 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_template_resource_base.php(128): content_59b2a9ca4219c6_30890325(Object(CMS_Smarty_Template))
#18 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_template_compiled.php(172): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(CMS_Smarty_Template))
#19 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_internal_template.php(206): Smarty_Template_Compiled->render(Object(CMS_Smarty_Template))
#20 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(216): Smarty_Internal_Template->render(false, 0)
#21 /home/ap3t/domains/mijnsite.be/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(107): Smarty_Internal_TemplateBase->_execute(NULL, 'p45', NULL, NULL, 0)
#22 /home/ap3t/domains/mijnsite.be/public_html/lib/classes/internal/class.CMS_Smarty_Template.php(20): Smarty_Internal_TemplateBase->fetch(NULL, 'p45', NULL, NULL)
#23 /home/ap3t/domains/mijnsite.be/public_html/index.php(158): CMS_Smarty_Template->fetch()
#24 {main}
Iemand enig idee waarom ik een 'Double timezone specification' error zou krijgen

Mvg,
Peter
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: ERROR Double timezone specification op LISE view

Post by pedes »

Lijkt op een kleine bug in de code van LISE.

Nl. in de file modules/LISE/lib/class.lise_datetime_utils.php
staat volgende:

Code: Select all

public static final function unix_ts_to_date($value, $format)
  {
    $datetime = new DateTime("@$value");
    return $datetime->format($format);
  }
die "@$value" moet "$value" zijn, denk ik...
als de @ wegneem is alles weer ok.

Mvg,
Peter
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1922
Joined: Mon Jan 29, 2007 4:47 pm

Re: ERROR Double timezone specification op LISE view

Post by Jo Morg »

I've been following this thread although I had to use a translator to understand it...

There is no bug in LISE in that function. You must have an issue elsewhere: that function expects an UNIX timestamp, which consists of a string of numeric characters, and prepends it a "@" character to make the conversion to the UNIX timestamp format accepted by the constructor of the DateTime object.

So...
lise_datetime_utils::unix_ts_to_date('11-02-2017', 'd-m-Y')
means the function is being called with an already formatted date which is not what is expected at this point.
One of the possible sources for this issue is: upgrading from an old version of LISE or from a ListIt2 conversion where dates where kept in the database in text formatted as a JS or JQuery localized datetime and not having the "Backwards Compatibility" option checked. These and PHP date time formats have little in common so converting from one to the other is not straightforward in some edge cases.
Also the previous way of storing datetimes masde it not too easy to sort chronologically on some locales if not, sometimes, impossible. Sorting was all made alphabetically (still is) so when the format was not meant to be sorted alphabetically (meaning when sorting alphabetically and chronologically didn't present the same results) things got overly complicated.
So LISE introduced a new way of storing datetimes in UNIX timestamp format (although still in text format as far as the database field is concerned) in which sorting alphabetically and chronologically always match. This way LISE makes the best possible guess at converting the format to a UNIX timestamp, and back to the format chosen to be presented to the user but always sort at the database level on the query.
For those instances still having the old format there is a "Backwards Compatibility" option on the field definition to keep all working as before. Just won't sort chronologically so easily if at all.

Obviously you can't have mixed formats for that particular field...

If that is not the case something else is very wrong with that installation or LISE instance, or the original format of the date and time is one of those edge cases I talked about.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: ERROR Double timezone specification op LISE view

Post by pedes »

thank you for this reply Fernando.

It is like you said, this is a site that ran with very old version of CMSMS and also the Listit2 module.
I upgraded the site to the latest CMSMS version and also during that upgrade I needed to upgrade to the LISE module.
It took me alot of time to get it all running, because there where alot of different modules.

I could not find why I got this error about the Double timezone specification. So I started to check the code line and removed (to try something) the @. I also thought this would probaly come from the ListIt2 conversion.

I looked over the Backwards Compatibility checkbox, that solved the problem like you said (I have put back the @ in the modules/LISE/lib/class.lise_datetime_utils.php file)

Also like you tell it is not sorting on the date field with the orderby tag, well it is sorting but not correct.

Thank you for this information, LISE is a great module.
Kind regards
Peter
Post Reply

Return to “Dutch - Nederlands”