WP_Debug breaks CiviCRM Menu Bar
To replicate using most recent versions of WP and CiviCRM
- Add define('WP_DEBUG', true); to wp-config.php
- Refresh page on CiviCRM.
If a debugging message is present, it will be at the top of the page. This is breaking the Menu Bar JS. Here are the console errors.
Error: CRM.url called before initialization Common.js:1481:31 console https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/Common.js?r=2QOSS:1481 url https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.ajax.js?r=2QOSS:19 initialize https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:18 https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:486 https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:488
SyntaxError: expected expression, got '<' admin.php:1
TypeError: tplURL is undefined crm.ajax.js:26:15 url https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.ajax.js?r=2QOSS:26 initialize https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:18 https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:486 https://sandbox.example.org/wp-content/plugins/civicrm/civicrm/js/crm.menubar.js?r=2QOSS:488