Extension, Fieldtype, Module

Archived
Forum
(read-only)

Event Helper

ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Derek Hogue

     

Issue with Channel Form/Custom fields tag pair.

General

Boiler Room Digital
Boiler Room Digital

Hello.

I have a channel with three Event Helper fields. I’m trying to display them on the front end of my site. I’m finding that if use the {custom_fields} tag pair to loop through my custom fields, they display correctly if I just use “{display_field}” like this:

{if event_helper}
    {display_field}
{
/if} 

but if I try to use a Bootstrap datepicker, or want to display the field value another way, then {field_data} just returns the Unix timestamp (which I could convert with a plugin).

The problem is that it for one of the fields, the {field_data} tag is just visible in the field. Any idea why? I can’t see the reason why, or see the difference between the different field types.

Also - a separate but related issue - when I switch a date field to an Event Helper field, or vice versa, I’ll get an error like this:

SQLSTATE[42S22]Column not found1054 Unknown column 'field_id_96' in 'exp_channel_data':
ALTER TABLE `exp_channel_dataCHANGE `field_id_96` `field_id_96INT(10)

ee/legacy/database/drivers/mysqli/mysqli_connection.php:122 

I guess it’s because date fields are called field_dt_XX rather than field_id_XX, but Event helper fields are called field_id_XX. Anything you can do about this, or is an EE bug?

It gets worse as by switching a field from a date type to an Event Helper type, I can actually lose all the field data altogether - the columns in the exp_channel_data table disappear completely, and it then borks search in the control panel and other issues

(I’m on the latest version of EE and event helper, though this is a site I upgraded from EE 2.5.2 - I had to change some of the fieldtypes in the database as I was getting errors all the time. Not ideal but possible that’s the source of some of the issues).

Appreciate any help you can offer.

Derek Hogue
# 1
Developer
Derek Hogue

Sorry for the headache. Regarding {field_data} no parsing for a single field, that’s a head-scratcher. It is expected that the raw field data would be a UNIX timestamp (as that’s what is stored in the DB). Honestly I never use the {custom_fields} tag pair in Channel Forms as it offers less customization than doing each field individually.

Re: the error you’re getting when switching fieldtypes, this appears to be a bug in EE - during the conversion the previous columns are dropped rathe than simply converted. I can reproduce it locally when changing a Date field to an Event Helper field, though converting an Event Helper field to a Date field does work. I’ll file a bug report and see what EllisLab has to say.

Boiler Room Digital
# 2
Boiler Room Digital

Thanks for this - I’ve been able to work around it for now.

Derek Hogue
# 3
Developer
Derek Hogue

Quick update - this has been confirmed as a bug in EE, which is fixed for the next release. Thanks for reporting it!

Boiler Room Digital
# 4
Boiler Room Digital

Great - thanks.