Custom Form | Invalid Month Value: '0'

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Custom Form | Invalid Month Value: '0'

Postby IanGP » Wed Sep 25, 2019 6:08 am

VERSION: 2.14-697a
BUILD: 190121-2019

Hi,
We have picked up an interesting problem on one of our Custom Forms:
When clicking on the calendar, we get an error:
Invalid Month Value: '0'
Allowed range is 01-12


And the reason we get this is because the value in the field is 0000-00-00
Once we edit that to 2019-09-25, all good.

So question is why is 0000-00-00 being populated?
According to the manual:
DATE field types: the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today.


This is happening on leads coming in via API. And we don't write to custom form on this campaign.

TIA
IanGP
IanGP
 
Posts: 59
Joined: Thu Jul 28, 2016 1:27 am

Re: Custom Form | Invalid Month Value: '0'

Postby mflorell » Wed Sep 25, 2019 8:11 am

Have you tried populating the date in the API requests that you send?
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Custom Form | Invalid Month Value: '0'

Postby IanGP » Wed Sep 25, 2019 11:12 am

Hi Matt,
It's not something we can easily change, as we rely on the lead provider (and their change control processes) to change that string.
One thing I tried was set the default value in the custom form, to 2019-01-01, but no change.
Thanks
IanGP
IanGP
 
Posts: 59
Joined: Thu Jul 28, 2016 1:27 am

Re: Custom Form | Invalid Month Value: '0'

Postby mflorell » Wed Sep 25, 2019 3:43 pm

I was just asking for you to test that, not make the change with your lead providers. That would confirm if it is an API issue or not.
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Custom Form | Invalid Month Value: '0'

Postby blackbird2306 » Sat Sep 28, 2019 6:10 am

I can provide you an interim solution to work round the error until you have an appropriate solution. This error comes from "calendar_db.js" file, where a control routine checks the right format of your date. You can bypass this with a small change. Look into the calendar_db.js file in "/srv/www/htdocs/vicidial" (admin part) and "/srv/www/htdocs/agc" (agent part):

change line 26 from:
if (n_month < 1 || n_month > 12)

to:
if (n_month < 0 || n_month > 12)

Try it out, because I didn't search in the code for further date format checks (e.g. in php part)!
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm


Return to Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 82 guests