If you constantly receive this error message there are usually five possible causes.
- The email address is not valid, or no email address has been specified in the custom fields. Ensure an email address is listed in the custom fields.
- Another user has since booked the available time or the calendaring hours have changed and the appointment is now busy.
- You are using PBBooking <= 188.8.131.52 and there is a conflict between Mootools and jQuery
- You are using PBBooking >= 3.0.0 and jQuery is being loaded multiple times on the page
- You are using PBBooking >= 3.0.0 and your host has mod_security installed and is blocking needed files.
I will step through the final three in more detail.
PBBooking <= 184.108.40.206 and Mootools / jQuery Conflicts
When using both MooTools and jQuery on the same page jQuery needs to be running in noConflict mode() to avoid overwriting the MooTools
$ selector. You can find out more about jQuery’s noConflict() mode in the jQuery docs here: http://api.jquery.com/jquery.noconflict/
To ensure jQuery is running in noConflict() mode find where jQuery is being loaded and ensure that the line:
appears immediately after.
NB: It is is important that the call to
jQuery.noConflict() occurs, immediately after loading jQuery.
You can test whether jQuery is correctly running in noConflict() mode by using something like Chrome Developer Tools. Open Chrome Developer Tools and go to
Console and just type: $
If jQuery and MooTools are both working correctly then the output should be:
You can see from this image that the
If jQuery and MooTools are not working correctly together then the output will return the below.
In this second example you can see that the
To correct this you need to identify which extension or template is loading jQuery without including noConflict() mode and correct accordingly. This may require either trial and error, or the extension may be identified in the URL used to load the jQuery library.
PBBooking >= 3.0.0 and jQuery Is Being Loaded Multiple Times on the Page
Joomla 3.3 has made a lot of things easier, most notably is that jQuery is now a standard part of the CMS.
In Joomla 3.3 the syntax to load the jQuery framework is
Jhtml::_('jquery.framework');. The advantage with loading jQuery using the CMS provided helper is that loads only one instance of jQuery regardless of how many times the helper is called.
Unfortunately there are still situations where jQuery is loaded multiple times on the page. This will increase page load times and also cause problems where a developer has previously loaded jQuery based plugins.
PBBooking uses two jQuery plugins:
- jquery-dateFormat – used for formatting of dates and tracking the start and end date of bookings
- jquery-cookie – used to store user information to a cookie that can reload information between page refreshes when changing dates in single page checkout.
You can tell if this is a problem by viewing the source of your document and checking for the following:
To correct this you need to identify which extension or template is loading jQuery without using the
Jhtml::_('jquery.framework') command. This may require either trial and error, or the extension may be identified in the URL used to load the jQuery library.
PBBooking >= 3.0.0 and Your Host Has Mod_Security Installed
This means that when PBBooking tries to use the jquery.cookie() function to reload user data the function is not there and throws an undefined function error and preventing the rest of the script from running on that page.
You can check if this is a problem by using something like Chrome Developer Tools. If mod_security is blocking this file you will see something like the below:
To correct this just get your host to add an exception to your hosting account for the specific mod_sec rule. They will know how to do this, it’s quite an easy process and usually takes less than 5 minutes to find the rule and whitelist. On my host with the current version of mod_sec the rule that was causing the problem was rule ID 1234123404. But they can double check the rule ID in the error_logs.
If they can’t or won’t do this for you raise a support ticket and I will be able to give you a change to remove the need for it. The problem is that it will mean the user will need to re-enter their information on every page refresh. For example if they select one date, enter all their data but then can’t find a timeslot and go to another day they will have to enter their data all over again.