Hi websitu,
Thank you for reporting.
Yes, the plugin contains an older version of select2 library. I will update in next 2 days and reply back.
I am not able to make sense of this line though
BuddyPress Xprofile Custom Field Types” plugin overwrites the select2 JavaScript included by GeoDirectory
If they want, they can unregister and register the select js. The only reason it might be getting overwritten is they might be using the same handle as us and our script registration might be happening after theirs.
Regards
Brajesh
Thank You Brajesh – I’ll report back after the update
Thank you for the patience.
I have updated the plugin with the latest release.
Please do let me know if it works for you or not? If the GeoDirectory support needs any clarification regarding how I enqueue the script, Please do let me know. I will be glad to assist.
Regards
Brajesh
Hi Brajesh
I updated your plugin however still experiencing the same issue. I contacted Geodirectory support and the response is shown below. Thank You for your assistance in this matter
Hi,
It is still loading bp-xprofile-custom-field-types/assets/vendors/select2/select2.min.js?ver=4.0.2 on GD CPT custom field settings page.
Updated BuddyPress Xprofile Custom Field Types plugin still loading the basic version of select2 and it results in JavaScript Error: “No select2/compat/dropdownCss”. Please ask him to load full version of select2.
Hi Wesitu,
Thank you for the details. Can you please point me to the geodirectory plugin page? Is it available on wp.org?
I am not sure why the Geo directory team can not enqueue their own version of select2. They can either register their handle at higher priority of deregister and register their own. Both approach will work fine.
I am not including the full because this plugin does not need the full version. Please see the difference and recommendation on select2 site
https://select2.org/getting-started/builds-and-modules
Here is what they say about selec2.full.js
You should only use this build if you need the additional features from Select2, like the compatibility modules or recommended includes like jquery.mousewheel
We don’t need it and that’s why we don’t include it.
Also, It does not seem they are interested in solving it, so I will point my usage here
https://github.com/buddydev/bp-xprofile-custom-field-types/blob/master/src/bootstrap/class-assets-loader.php#L43
We do register the “select2” handle but only load the script conditionally on front end user registration, user profile edit on front end and user profile edit inside the dashboard.
If the script is being loaded on their post type from our code it simply means we have a conflict on the name of handle and since they need the full js, they can easily solve it by registering their script early.
Please let me know their response. I am hoping that they can register early and resolve it.
Regards
Brajesh