Skip to content

Fix jQuery version#1309

Open
fbacall wants to merge 2 commits into
masterfrom
fix-jquery
Open

Fix jQuery version#1309
fbacall wants to merge 2 commits into
masterfrom
fix-jquery

Conversation

@fbacall
Copy link
Copy Markdown
Member

@fbacall fbacall commented May 20, 2026

Summary of changes

  • Load jQuery 3.7.1 (from jquery-rails) instead of version 1.x.
  • Fix JS eval error when loading calendar.
  • Bump jquery-rails version

Motivation and context

Events calendar was not loading due to CSP violation caused by old jQuery trying to use eval.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Rails asset pipeline to load modern jQuery (via jquery-rails) and adjusts the events calendar AJAX loading to avoid CSP issues caused by executing returned JavaScript via eval.

Changes:

  • Bump jquery-rails to 4.6.1 and switch the asset manifest to require jquery3 (jQuery 3.7.1).
  • Change calendar loading to use jQuery’s built-in dataType: 'script' execution instead of eval.
  • Remove the explicit .js format from the calendar URL so format negotiation can occur via the AJAX request.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
Gemfile.lock Bumps jquery-rails to 4.6.1.
app/views/events/index.html.erb Adjusts calendar tab’s data-calendar URL to drop the explicit format: :js.
app/assets/javascripts/application.js Loads jquery3 and updates calendar AJAX loading to avoid eval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mikesndrs
Copy link
Copy Markdown
Contributor

probably should add test to check if calendar is available

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.

3 participants