• Resolved markjohnl

    (@markjohnl)


    Hi,

    When I try to edit the widget through the customizer I get the following message:

    ReferenceError: DOPBS_tinyMCE_data is not defined

    It works fine under the widgets section, but I’m encouraging my clients to use the customizer.

    I also have the Booking system plugin installed – https://www.ads-software.com/plugins/booking-system/

    When I disable their plugin, your plugin works. I’ve posted to their support area also in case they are able to see what is causing the conflict.

    I’ve recreated the exact same error on three different sites, so I’m confident that it isn’t a one-off and that the two plugins aren’t playing nice together.

    I hope you can help?

    Thanks,

    Mark

    https://www.ads-software.com/plugins/black-studio-tinymce-widget/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marco Chiesi

    (@marcochiesi)

    The problem is caused by the Booking system plugin not supporting explicitely the WP theme customizer.
    You need to modify the dopbs-backend.php and add the following line:

    add_action('customize_controls_print_scripts', array (&$this, 'tinyMCECalendars'), 30);

    just after

    add_action('admin_head', array (&$this, 'tinyMCECalendars'));

    around line 759.

    Beyond that, there’s a z-index issue which prevents the booking system dropdown menu from being visible. Here’s a very dirty workaround for that too. Change the script in tinyMCECalendars function (around line 746) to this:

    echo '<script type="text/JavaScript">'.
                         '    var DOPBS_tinyMCE_data = "'.$tinyMCE_data.'",'.
                         '        WP_version          = "'.get_bloginfo("version").'";'.
                         '    jQuery(function($){$(".wp-full-overlay").css("z-index",100000);});'.
                         '</script>';

    I will post this fix also to the relevant topic in Booking system support forum.

    Hello,

    Please remove this line

    jQuery(function($){$(".wp-full-overlay").css("z-index",100000);});'. </pre>
     from
    <pre>echo '<script type="text/JavaScript">'.
                         '    var DOPBS_tinyMCE_data = "'.$tinyMCE_data.'",'.
                         '        WP_version          = "'.get_bloginfo("version").'";'.
                         '    jQuery(function($){$(".wp-full-overlay").css("z-index",100000);});'.
                         '</script>';</pre>
    and add this, to your theme
    <pre>$(".wp-full-overlay").css("z-index",100000);

    Thank you.

    Plugin Author Marco Chiesi

    (@marcochiesi)

    I think that the z-index issue should be addressed at WP core level, since it’s independent from a specific theme and it probably affects every plugin that adds a dropdown to the editor. The dirty trick I suggested was intended just as a temporary workaround.
    By the way, even if it’s unrelated to the issue, I would suggest the use of wp_localize_script to pass data from PHP to JS. As the Codex says, though localization is the primary use, it can be used to make any data available to your script that you can normally only get from the server side of WordPress.

    Thread Starter markjohnl

    (@markjohnl)

    Thanks guys. Sorry for taking so long to reply, for some reason gmail dropped your replies into my junk folder.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Booking system conflict’ is closed to new replies.