I have a date/time field that I don't want to display; it's for Views logic only. So I set it to Hidden in the content type's display settings.

Now for every one of these nodes on the page, I get an error:

Notice: Undefined index: format_type in tpl_field_vars_datetime_fieldvalue() (line 494 of sites/all/modules/tpl_field_vars/tpl_field_vars.module).

It's easy enough to set the field to displayed and then just not output it in the template, of course. Just passing this along.

Comments

lanny heidbreder’s picture

I just realized that it's not only when the field is hidden; it also happens when the field is shown, but the format is set to Plain.

ambaum2’s picture

Issue summary: View changes
StatusFileSize
new662 bytes

I'm having problems with this too. It just clutters up the log since users often like to hide fields and I don't want to have to monitor that.

I think just setting $date_format variable to an empty string if no format type is found would be fine. The format method in DateTime http://php.net/manual/en/class.datetime.php ignores empty strings so this change should be fine.

Jaza’s picture

Version: 7.x-1.14 » 7.x-1.x-dev
Status: Active » Needs review

  • Jaza committed 420f303 on master, 7.x-1.x
    Issue #1954374 by 75th Trombone, ambaum2: Hidden Date fields result in...
Jaza’s picture

Status: Needs review » Fixed

Thanks - committed! Have released 7.x-1.24 with this fix.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.