Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the django autocomplete / select2 upgrade bug #593

Merged
merged 1 commit into from
May 28, 2024

Conversation

mrchrisadams
Copy link
Member

@mrchrisadams mrchrisadams commented May 28, 2024

This PR introduces two things:

  1. an override of the hosting provider change_form, to allow us direct control over which scripts are loaded by the page, and in what order
  2. a concatenated javascript file, created to overcome the incredibly frustrating clash of different versions of jQuery, select2 and other scripts being loaded onto the page, that led to the autocomplete tag widget failing to load properly since we upgraded Django.

There is no magic for the concatenated file, and I am not using any bundling tools - it's literally a file where I have pasted the files in the order we need them to load, and will need to be updated when we make any further changes to this hosting provider admin page.

We're in the process of removing access to these django admin pages to non-staff users - so while the new 'compiled' javascript file makes for a large uncompressed file, the difficulty of fixing this bug has led me to err towards having a slower loading, but easier to debug page for when we have to come back to this.

By using a 'compiled' version, and explicit ordering
in the admin override template
@mrchrisadams
Copy link
Member Author

@mrchrisadams mrchrisadams merged commit afc8c25 into master May 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant