Plugin

Archived
Forum
(read-only)

DT Plugin

ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Jerry Price

     

Channel Form question

Support Request

springworks
springworks

I’m trying to use DT Plugin to set the expiration date of an entry submitted using a Channel Form to be 1 year after the submission date.

I can’t figure out how to do this and keep getting the following error when I try to cal DT Plugin:

Fatal errorCall to undefined method Localize::decode_date() in /system/expressionengine/third_party/dt/pi.dt.php on line 98 

This is with EE 2.8.0 and DT Plugin 1.4.1.

Here’s the line I’m using in the {exp:channel:form} tag:

<input type="hidden" name="expiration_date" value="{expiration_date}" value="{exp:dt month="12" set="{current_time}" format="%%%%H:%i:%s"}"

Any ideas on how I can get this working?

VIM Interactive
# 1
Developer
VIM Interactive

Could be a code change in the latest EE release causing it to fail.  I will take a look and try to update it in the next day or so.

springworks
# 2
springworks

I’ve solved the problem. You just need to replace calls to

decode_date() 

to call

format_date() 

instead.

These appear on lines 98 and 185 of the plugin code.

I’ve attached a revised version of the plugin with these changes made that is working for me on EE 2.8.0.

File Attachments
pi.dt.php  (File Size: 10KB - Downloads: 66)
VIM Interactive
# 3
Developer
VIM Interactive

Thanks for the heads up and getting the fix. I posted the update to the plugin.