If you constantly receive this error message there are usually six possible causes. On PBBooking versions > 3.0.0 the third point is usually the problem.
- 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 have a problem with your custom field configuration. Your custom field variable names cannot contain spaces or special symbols.
- You are using PBBooking <= 126.96.36.199 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 four in more detail.
You have a problem with your custom field configuration
This is by far the most common cause of this error. When you configure your custom fields you can define both a field name AND a variable name. The field name has no formatting restrictions. You can use any characters you like here including spaces, underscores, and special symbols. The variable name on the other hand is used as an index for an associate array. It CANNOT contain spaces, hyphens, or other special symbols excluding the _ symbol. You can edit your custom fields by going to the main PBBooking dashboard and clicking on customfields. Select the custom field you need to update and click edit.
PBBooking <= 188.8.131.52 and Mootools / jQuery Conflicts
$ 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:
jQuery.noConflict(); 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
In this second example you can see that the
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.
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
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.