Suitecrm: Campaign Wizard: Missing required field: Start Date

Created on 13 Jun 2017  路  9Comments  路  Source: salesagility/SuiteCRM


This has been reported before by a number of people including me.

When using the campaign wizard to create and launch a campaign you are required to use the "next button" to continue, this will fail at "Marketing" as the date CANNOT BE SET - it refuses to accept any date.

It is a REAL hassle as people cannot send campaigns.

Issue

I have set the correct and required information in php.ini:
date.timezone="Australia/Melbourne"

I have also set in the admin panel the following information:
date format: 23/12/2006
time format: 23:00

I have also set the same information for the users dealing with campaigns.

Yet there is a message in the LOG file for SUITECRM
Tue Jun 13 11:31:36 2017 [11137][1][ERROR] convert: Conversion of : 00.00 from d/m/Y H.i to Y-m-d H:i:s failed
Tue Jun 13 11:31:54 2017 [11137][1][ERROR] convert: Conversion of 13/06/2017 11:00 from d/m/Y H.i to Y-m-d H:i:s failed

Note that the time for the log message "Tue Jun 13 11:31:36 2017" is the exact time and date when it happened.

Expected Behavior

The wizard should accept the date for the SELECTED time and date.
We do not enter the time by hand but use the provided calendar.

Actual Behavior

The wizard DOES NOT accept the date for the SELECTED time and date.
We do not enter the time by hand but use the provided calendar.

Possible Fix

I checked where this error happens but do not have enough time to fix this, further I do not 100% understand the DATE TIME classes of SuiteCRM.

The error is created in the file "SUITECRMINSTALL/include/TimeDate.php" on line 963, alternatively search for "convert:" in the file.

The correct time zones are passed to the function (UTC, Australia/Melbourne), the correct time is passed. Everything seems alright but I cannot get passed this function.

Steps to Reproduce



There are many possible ways to get to this bug. Once possible way is to EDIT the campaign again to actually send a test email, you cannot go past "Marketing", it does not accept the date.

  1. create a campaign
  2. create a template
  3. go back to view campaigns
  4. select/edit campaign
  5. click "next" to go to Marketing
  6. enter a date, marketing email name and other required fields
  7. it will come back to the same Marketing, with ALL fields filled out BUT THE DATE
    it will display error: Missing required field: Start Date

Context


People cannot send campaigns without me filling out the missing dates in the DATABASE.
I need to DIRECTLY enter the dates into the database - but even that makes it fail half the time.

To actually SEND the campaign I need to bypass everything I need to do the following

  • go to list campaigns
  • click on the campaing
  • on the button left top corner click on "send test" or "send emails"

Your Environment

  • SuiteCRM Version used:
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): DOES NOT MATTER
  • Environment name and version (e.g. MySQL, PHP 7): 5.6.30 and 7.2.2
  • Operating System and version (e.g Ubuntu 16.04): CentOS
Critical Fix Proposed Bug

Most helpful comment

I think this should be resolved in #4702

According to the error message from the OP

Tue Jun 13 11:31:54 2017 [11137][1][ERROR] convert: Conversion of 13/06/2017 11:00 from d/m/Y H.i to Y-m-d H:i:s failed

The expected format in the convert function was d/m/Y H.i but the time string supplied was 13/06/2017 11:00.

After the changes I made I have not been able to reproduce this error anymore.

All 9 comments

When I had this problem I found that the Wizard always fails the first time, dropping my Start Date setting, but always works the second time. So all I have to do is insist and I get through.

Of course this is still a bug, but I wonder if the same workaround works for you, @jobst?

@pgorod - thanks but that did not work for me ... I do this by adding the date to the campaigns and email_template tables using phpMyAdmin.
I also do not go fully through the Wizard, once I get to the table with the start_date problem I stop, then view campaigns, select campaign and then send using the "Actions" button.

Hi, Facing the same issue ... SuiteCRM version 7.9.1 , Centos 7 & MariaDB

@pgorod tried setting up the date 2-3 times but of no use.

is there a way to set the default date like now() so as to bypass it. Any help, appreciated.

@Dillon-Brown I would recommend raising this to High Priority because it would be a pity not to have this fixed in 7.9.2. We're seeing this very frequently, and it totally breaks Campaigns. On the other hand, it shouldn't be too difficult to fix for someone who can step through the code and debug...

@pgorod, @Dillon-Brown: There is a POSSIBILITY I figured it out, however due to the cirumstances involving the date/time stuff YMMV. I UNDERSTAND - because one user can be in the US while another user can be in OZ and the install of SuiteCRM could be in London - date/time IS tricky!

I put some debug statements into the function "_convert" to find/show the parameters that come into the function, also just before and after the error which helped me finding the problem.

The install of this Suitecrm install is in Melbourne, so my php.ini file contains
date.timezone="Australia/Melbourne"

My Locale (Admin section) has
Date Format: 23/12/2006 (6th of the list)
Time Format: 23:00
Language: English UK (as there is not AUS Option)

My Profile has
Date Format: 23/12/2006 (6th of the list)
Time Format: 23:00
Time Zone: Australia/Melbourne (10:00)

Coming into the function _convert() (I just used some silly date so I could actually see it in the logs):
DATE -> 2000-06-21 01:00:00
fromFormat -> Y-m-d H:i:s
toFormat -> DateTimeZone Object
(
[timezone_type] => 3
[timezone] => UTC
)
toTZ -> DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Australia/Melbourne
)

Now when I make a MISTAKE and set the TIME in MY profile form 23:00 to 23.00 it stuffs up and the error "convert: Conversion of 13/06/2017 11:00 from d/m/Y H.i to Y-m-d H:i:s failed" will show up.
If I set the time setup in my profile to 23:00 it accepts the time/date in the wizard and moves on.

I checked with the main person dealing with campaigns in our company and set her time setting from 23.00 to 23:00 and it worked for her as well.

I guess the problem within the campaign wizard is due to the different ways time and date can be displayed (and users want that,too) -- but the underlying code does not solve this properly?

There was a somewhat similar issue in the forums a while ago. A missing start date generated a similar error in format conversion.

And there was another issue here #3609 where the language pack had an additional line break and was causing the mandatory fields mechanism to fail.

I don't know if any of these help...

Anyway, @jobst, if you can now make this happen in reproducible steps, on the demo, or on a fresh system, then it's time to step through the code with a debugger and just get on top of the problem. Can you reproduce this on the demo? If you need admin access to change settings, use the Softaculous demo.

@pgorod I'll raise this as a higher priority. Although it seems like this issue is intermittent.

In 7.8.6 this was caused by : vs . as date separator. Changing . to : in user profile fixed it.

I think this should be resolved in #4702

According to the error message from the OP

Tue Jun 13 11:31:54 2017 [11137][1][ERROR] convert: Conversion of 13/06/2017 11:00 from d/m/Y H.i to Y-m-d H:i:s failed

The expected format in the convert function was d/m/Y H.i but the time string supplied was 13/06/2017 11:00.

After the changes I made I have not been able to reproduce this error anymore.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vhex picture Vhex  路  3Comments

ajprouty87 picture ajprouty87  路  3Comments

ArturoBurela picture ArturoBurela  路  3Comments

Mausino picture Mausino  路  3Comments

connorshea picture connorshea  路  3Comments