Bug #22407 Version Retired

Template Parser, date variable order

Version: 2.11.3 Reporter: Frans Cooijmans

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

When parsing date variables in a custom module, this doesn’t work:

$date_from = time();

$variables['date_from'] = $date_from;
$variables['date_from_next'] = strtotime("+1 days",$date_from);
$variables['date_from_prev'] = strtotime("-1 days",$date_from);

return ee()->TMPL->parse_variables(ee()->TMPL->tagdata, array($variables));

{date_from_next} and {date_from_prev} are parsed with the value of {date_from}

if i assign the variables like this (in different order), it works:

$date_from = time();

$variables['date_from_next'] = strtotime("+1 days",$date_from);
$variables['date_from_prev'] = strtotime("-1 days",$date_from);
$variables['date_from'] = $date_from;

return ee()->TMPL->parse_variables(ee()->TMPL->tagdata, array($variables));

 

 

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases