Namespacing issue with cmb-field-select2
-
Hey,
I am a developer for CommonsBooking, a WordPress plugin that also uses a version of cmb-field-select2. One of our users reported an activation conflict with your plugin. We have traced back the issue to a duplicated import of the PW_CMB2_Field_Select2 class. Unfortunately, this creates a conflict because neither of us are using their own namespaces for our dependencies. Because we are a free plugin developed for the common good none of us have any time to properly namespace our dependencies right now. Maybe, for a quick fix, we could both add aif ( ! class_exists( 'PW_CMB2_Field_Select2', false ) ) {check in the cmb-field-select2.php? I see that you have already modified the dependency, so this should not be much work for you. Adding this check only on our end unfortunately does not cut it because you load the class after we do, hence it is already loaded and we receive the( ! ) Fatal error: Cannot declare class PW_CMB2_Field_Select2, because the name is already in use in ***/wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb-field-select2-master/cmb-field-select2.php on line 22error.
In case you should care, I have written it up on more detail in our GitHub (https://github.com/wielebenwir/commonsbooking/issues/1928) but these are mostly my thoughts on namespacing. Would the abovementioned solution work for you?
All the best
You must be logged in to reply to this topic.