In the appearance visual customizer, I’m getting the following error in my dev-tools log:
Uncaught Error: Minified React error #200; visit https://reactjs.org/docs/error-decoder.html?invariant=200 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Visitng the link shows this message:
Target container is not a DOM element.
Trace:
/url/to/wp-content/plugins/multisites-superlist/msl/build/static/node_modules/react-dom/cjs/react-dom.production.min.js:296:47
That line of code starts out with:
exports.render=function(a,b,c){if(!rk(b))throw Error(y(200));
That triggers: /url/to/wp-content/plugins/multisites-superlist/msl/build/static/js/index.js:8
with this code:
const mySites = document.querySelector('#wp-admin-bar-my-sites .ab-sub-wrapper');
ReactDOM.render(
<React.StrictMode>
<Sitelist />
</React.StrictMode>, mySites
);
And yes, sure enough, the admin bar is not present in the visual customizer and therefore not a valid DOM element.
I’m not getting the error in Gutenberg editor (also no admin bar), so it seems to be exclusively a react thing with the appearance visual customizer.
Fixed it by adding this line of code right at the beginning of the mssl_scripts() function on line 54 in multisite-superlist.php:
if ( get_current_screen()->id === 'customize' ) { return; }
Like I said, it seems to be exclusive to react in the visual customizer, but if there were any other parts of the admin panel where react is used and there’s no admin bar present, they could be added as screen ids to exclude pretty easily.
Thanks again for the awesome plugin!
]]>Getting the following ‘doing it wrong’ error:
“The REST API route definition for msl/v1/sites
is missing the required permission_callback
argument. For REST API routes that are intended to be public, use __return_true
as the permission callback.”
Fixed it with these changes in multisite-superlist.php mssl_register_sites() function starting on line 119:
array(
'methods' => 'GET',
'callback' => 'mssl_api_custom_route_sites',
'permission_callback' => function($request){
return is_super_admin( get_current_user_id() ) ? '__return_true' : '__return_false';
},
)
Thanks for the awesome plugin! Want to see it stay ahead of WP Core changes like this ??
]]>It would be really handy to be able to add custom CSS for the menu. The default styling doesn’t match my theme and the purple makes the black text on top almost impossible to read.
]]>Hi,
Is it possible to pre-configure to open links (Dashboard / Visit site / etc) in a new tab, instead of in the Superadmin network window?