Skip Navigation

[Transféré au 2e niveau] DatePicker is not working after updating toolset

This support ticket is created Il y a 4 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 23 réponses, has 3 voix.

Last updated by Beda Il y a 4 années et 4 mois.

Assisted by: Nigel.

Auteur
Publications
#1375385
date-error-2.PNG
date-error-1.PNG

I have a custom field as a date type and I use it in Post Form. After the latest update date picker is not working anymore:

Attached you can see the console error.

The error seems to be in the file: `cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/js/date.js`

The response is already an object. No need to parse it. If I remove the highlighted line the date picker is working.

Could you please have a look?

#1375435

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

As requested please share duplicator package:
=> https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#1376179

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please confirm what is the version of FireFox and Chrome browser you are using?

#1376183

Both are up to date:
Chrome: Version 78.0.3904.87 (Official Build) (64-bit)
Firefox: 70.0.1 (64-bit)

#1376187

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for sharing all the required information. I'll pass all this to our next level support. Please hold on for further updates.

#1376213

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

I got the news for our next level support as like me they do not able to see the issue with the duplicator package you shared.

The wp-admin access details you shared yesterday is not working at this end. Can you please share working wp-admin access details so that I can share that with our next-level support and they should investigate further.

I have set the next reply to private which means only you and I have access to it.

#1376229

The user I shared yesterday is open again you can log in with the same credentials.
I also asked some friends to check they all see the error

#1376251

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

We have a really strange situation here. Our next-level support even do not able to see the issue with your site or duplicator you shared.

Can you please do a favor and share a video with full screen that shows how to reproduce the issue.

#1376751

Yes sure thing, could you please set the next reply to private?

#1376869

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - the latest update is that our next-level support person able to spot the issue on Dev FireFox version but again its not replicable on the duplicator you shared.

As I suspected while it was chat ticket that it could be related to cache and now next level support has concluded that it must be related to cache. They spot that the code in FF developer edition is different from Chrome with the following file:

 /plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/js/date.js

Code from FF developer:

$.post(wptDateData.ajaxurl, data, function (response) {
response = $.parseJSON(response);
if (el_aux.length > 0) {
el_aux.val(response['timestamp']).trigger('wptDateSelect');
}
el.val(response['display']);
el_clear.css('display', 'inline-block');
el.prev('small.wpt-form-error').remove();
});

Code from Chrome:

$.post(wptDateData.ajaxurl, data, function (response) {
if (typeof ( response ) === 'string' || response instanceof String) {
response = $.parseJSON( response );
}
if (el_aux.length > 0) {
el_aux.val(response['timestamp']).trigger('wptDateSelect');
}
el.val(response['display']);
el_clear.css('display', 'inline-block');

//Fix adding remove label on date
el.prev('small.wpt-form-error').remove();
});

The code that causes the issue which is being shown in FF developer edition exists in Forms 2.3 and Types 3.0. That means the old file is loaded with somewhere from the cache.

The only way to check this issue further is I think you should try to move the same site to your local server or different server and check if you are able to fix the issue to check and eliminate the server cache.

#1377067

I moved the site to a local server, in that case, it is working.
I don't know what is wrong, I have cleared cache everywhere. I will also contact my hosting provider...
I just wondering, is there any case something is not set right about versioning when you register the date.js script:

wp_register_script(
	'wptoolset-field-date',
	WPTOOLSET_FORMS_RELPATH . '/js/date.js',
	array( 'jquery-ui-datepicker', 'wptoolset-forms' ),
	WPTOOLSET_FORMS_VERSION,
	true
);

I both cases(local and prod server) the version is `date.js?ver=0.1.2` but the files are different(differences that you have mentioned above)

Also in the link, I shared with you for the duplicator I added the video.

#1377069

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

I moved the site to a local server, in that case, it is working.
==>
This is what I suspected and as you acknowledge it works.

Unfortunately, I do not have any solution to share as I'm not able to reproduce the issue. You need to check with your hosting authority and ask them to clear all cache or maybe check with them to ensure from where that old version file is loaded. I believe that is the correct step to investigate and in the right direction.

#1377075
tool-ver.PNG

Ok, thanks for the support. I contacted the hosting provider and waiting for response.

One more question about versioning, I can see in your code:

define('WPTOOLSET_FORMS_VERSION', '0.1.2');
 

This one as mention above is the version of the date.js:

wp_register_script(
    'wptoolset-field-date',
    WPTOOLSET_FORMS_RELPATH . '/js/date.js',
    array( 'jquery-ui-datepicker', 'wptoolset-forms' ),
    WPTOOLSET_FORMS_VERSION,
    true
);
 

But the actual version Toolset Forms is: Version 2.5.2 (tool-ver.png attached)

The above could cause my issue, I mean if the version of the file is not set right.

#1377129

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for sharing but I do not think this could be the cause as when you load the site on your localhost where you confirm it works. I do not see logically it should affect the issue but I will share this information to our next level support and if they share anything is related to this issue I will get back to you but I dont think its related but yes, maybe we need to fix the constant with correct version in that file.

#1377139

Thanks, yes please share it. I believe it is related. The .js files will not be updated if the version is not updated. I am not supposed to clear all my cache every time I update any plugin. That's why file versioning is in place. Thanks again