Support Forum

 
You must be logged in to post
Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Date display error [01/01/1970]

Working on It
UserPost

7:42 pm
October 31, 2010


Gerard

1

I have a simple form in which I enter events (title, www link, start date end date, short description). The fields in this form are used to create a post entry and I also have a custom display based on this form which will list brief details on a events page (http://www.platformtechnologie…..ge_id=2112)

Initially, this form did not create a post entry and everything was fine in my custom display, however when I changed the field properties to create a post from this form, the date information went a little strange. The start date and end date are set as custom fields: start_date and end_date respectively.

Very basically, the date when entered is (for example) 28/11/2010. This date is shown correctly in the post entry/custom field and also when I edit the entry within Formidable. However, when the form entries are displayed in my custom display and when I am viewing all entries in the form using Formadable menus/Entries, the date is displayed as 01/01/1970. This has happened in 11 of the 14 date entries (ie not 100%, which is strange in itself)

I wonder if you can shed any light on this error?

Thanks!!

10:06 pm
November 1, 2010


Steph

2

Are the 11 entries linked to a post yet? My guess is that it's checking for a value attached to the post that isn't there. It sounds like a bug though. I have made a change for the next release, that may be helpful for you to make now.

Open formidable/pro/classes/helpers/FrmProFieldsHelper.php

Change lines 569-574 from:

if($post_id = $entry->post_id){
  $field_options = maybe_unserialize($field->field_options);
  $replace_with = FrmProEntryMetaHelper::get_post_value($post_id, $field_options['post_field'], $field_options['custom_field'], array('type' => $field->type));
}else{
  $replace_with = maybe_unserialize( $frm_entry_meta->get_entry_meta_by_field( $entry->id, $field->id, true ) );
}

to this:

if($post_id = $entry->post_id){
  $field_options = maybe_unserialize($field->field_options);
  if($field_options['post_field'])
    $replace_with = FrmProEntryMetaHelper::get_post_value($post_id, $field_options['post_field'], $field_options['custom_field'], array('type' => $field->type));
  else
    $replace_with = maybe_unserialize($frm_entry_meta->get_entry_meta_by_field($entry->id, $field->id, true));
}else{
  $replace_with = maybe_unserialize($frm_entry_meta->get_entry_meta_by_field($entry->id, $field->id, true));
}

Does that help at all?

6:07 pm
November 4, 2010


Gerard

3

yes, the 11 entries are linked to posts.

I modified the file. This doesn't appear to have corrected the issue.

[nb. this section started at line 584 (not 569). I am using FrmPro version 1.04.0]

10:41 pm
November 6, 2010


Steph

4

Sorry, we may be saying the same thing, but are the 3 entries that are working linked to posts as well?

I think I may need admin access to take a look at your issue. Can you send access to support at strategy11.com?

3:12 pm
November 10, 2010


Gerard

5

the three entries that display the correct date are also linked to posts.

I have sent login details to your email.

11:45 pm
November 10, 2010


Steph

6

That's fixed now. The issue was that the code was assuming mm/dd/yyyy format so the ones that weren't working weren't real dates in that format. Thanks for letting me troubleshoot this on your site.

12:56 am
November 11, 2010


Gerard

7

Thankyou! Im very glad that you make the time to address such issues. It is much appreciated !

 

I think there may still be some issues surrounding the date formatting.

eg. in my 'Events' custom display, when I use the logical filter option to limit the custom display so that old entries are automatically not shown, i.e "field end date is less than NOW", I get mixed results. Some of the events which are shown have end dates which are less than now (=correct) and some are greater than now (=not correct).

Same goes for when i select "greater than NOW" as my logical filter… except I get all the other events displayed. So, the filtering works correctly, however the date value is still a bit wacky.. (hope that makes sense)

Not an big issue, but thought you might be interested to know.

cheers

7:03 am
November 11, 2010


Steph

8

Thanks for the heads up. I haven't tested a date field in that format with the "where" options. I'm on it.

Working on It