Skip to content

Bail if script helper class does not exist#837

Merged
agibson-godaddy merged 1 commit into
release/6.2.1from
mwc-19746
May 18, 2026
Merged

Bail if script helper class does not exist#837
agibson-godaddy merged 1 commit into
release/6.2.1from
mwc-19746

Conversation

@agibson-godaddy
Copy link
Copy Markdown
Contributor

@agibson-godaddy agibson-godaddy commented May 18, 2026

Summary

This protects against fatal errors in the middle of plugin upgrades, when an admin notice is visible. This is a similar issue to #826

Story: MWC-19746

Release: #836 (release PR)

Details

Screenshot 2026-05-18 131357

QA

If applicable, add specific steps for the reviewer to perform as part of their QA process prior to approving this pull request. Steps should be in a step -> success? format, like below

Setup

  1. Activate a plugin that has an admin notice visible.
  2. Manually apply the patch to the current version of the plugin. This is necessary because it's the old version (before the update) that needs the fix.
  3. Upload a new version of the plugin, containing this branch of the plugin framework.
    • No fatal error on upgrade screen
image

Before merge

  • I have confirmed these changes in each supported minor WooCommerce version

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 adds a defensive guard to admin notice JavaScript rendering to avoid fatal errors when ScriptHelper is unavailable during plugin upgrades.

Changes:

  • Adds a class_exists() check before using ScriptHelper.
  • Updates the 6.2.1 changelog with the upgrade fatal-error fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
woocommerce/class-sv-wc-admin-notice-handler.php Guards admin notice inline script rendering when ScriptHelper is unavailable.
woocommerce/changelog.txt Documents the plugin-upgrade fatal error fix.

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

Comment thread woocommerce/class-sv-wc-admin-notice-handler.php
@agibson-godaddy agibson-godaddy marked this pull request as ready for review May 18, 2026 12:37
@agibson-godaddy agibson-godaddy merged commit fe4cebf into release/6.2.1 May 18, 2026
6 checks passed
@agibson-godaddy agibson-godaddy deleted the mwc-19746 branch May 18, 2026 12:37
@agibson-godaddy agibson-godaddy mentioned this pull request May 18, 2026
2 tasks
agibson-godaddy added a commit that referenced this pull request May 18, 2026
* Fix resolved package urls

* Version 6.2.1

* Bail if script helper class does not exist (#837)

* Set release date

---------

Co-authored-by: Ashley Gibson <agibson@godaddy.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ashley Gibson <99189195+agibson-godaddy@users.noreply.github.com>
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.

2 participants