MinnPost / object-sync-for-salesforce

WordPress plugin that maps and syncs data between Salesforce objects and WordPress objects.
https://wordpress.org/plugins/object-sync-for-salesforce/
GNU General Public License v2.0
94 stars 51 forks source link

Select2 Library Should Be Integrated in an Isolated Way, Like Advanced Custom Fields Does #405

Closed timnolte closed 3 years ago

timnolte commented 3 years ago

Is your feature request related to a problem? Please describe. The way this plugin implements the Select2 library is such that it's not isolated and has problems/conflicts with other plugins that also use the library. And while those other plugins should also be integrating Select2 in an isolated way this plugin can protect itself by taking that approach.

ACF also uses Select2, but they have integrated it such that it is isolated from any other plugins that also use the library, so there is never any conflicts. This issue warrants another issue really. This plugin should be using the Select2 library such that i can be loaded side-by-side with other plugins using different versions of the library. ACF should be the model of how it should be implemented.

Describe the solution you'd like You should be able to see how Advanced Custom Fields, or maybe others, are integrating the Select2 library such that it is initialized for the plugin in a way that keeps it isolated an not prone to conflicts with other versions/plugins.

Describe alternatives you've considered Disabling Select2 altogether is the only other solution right now, in addition to other plugins also adopting this approach of isolation.

Additional context There is a bug in the object_sync_for_salesforce_select_library that when return an empty string to disable Select2 it breaks the Fieldmaps screen for adding new field map lines. I'm opening up another issue for that specifically.

jonathanstegall commented 3 years ago

Agree that this is a bug, but I don't think we need a duplicate feature request for it.

timnolte commented 3 years ago

@jonathanstegall OK, I figured this sort of change was not quite a bug but just a matter of implementation choice. The other issue I opened does seem to be a bug in the cases when you use the hook to disable Select2. 🤷‍♂️