WPDM Premium Packages – Causing JavaScript Errors all over

Viewing 2 posts - 1 through 2 (of 2 total)
#64737

Shawn Rebelo
Member

This plugin is causing problems for other plugins. It breaks everything except Download Manager.

The reason:
Download Manager is loading DateTimePicker. That is only loaded when adding a file, that’s good.
WPDM Premium Packages wpdmpp-admin.js is loaded with other plugins and on line 45 it calls datetimer picker.
It crashes all other JS. “Uncaught TypeError: $(…).datetimepicker is not a function”.

A fix:
Line 45:
Replace
$('#sales-price-expire-field, .coupon_expire').datetimepicker({dateFormat:"yy-mm-dd", timeFormat: "hh:mm tt"});
With:

	if($('#sales-price-expire-field').length || $('.coupon_expire').length){
		$('#sales-price-expire-field, .coupon_expire').datetimepicker({dateFormat:"yy-mm-dd", timeFormat: "hh:mm tt"});
	}

Line: 94
Replace:
jQuery('.taxstate,.taxcountry,.wpdmpp-currecy-dropdown').chosen({width:'200px'});
With:

	if($('.taxstate').length || $('.taxcountry').length || $('.wpdmpp-currecy-dropdown').length){
    	       jQuery('.taxstate,.taxcountry,.wpdmpp-currecy-dropdown').chosen({width:'200px'});
	}
#64756

Shahriar
Moderator

Hi Shawn,

Thanks a lot  for reporting the issue. We are releasing a new version of Premium Package to fix this issue.

Best Regards.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘WPDM Premium Packages – Causing JavaScript Errors all over’ is closed to new replies.