godaddy-wordpress / godaddy-wordpress/wc-plugin-framework
Token editor scripts accidentally loaded in FSE themes
- Dominant language
- PHP
- Stars
- 146
- Forks
- 43
- Avg merge
- 21m
- Merged PRs (30d)
- 3
Description
Hey there 👋
When a gateway is active, the token editor scripts from the SV framework are attempted to be loaded in FSE themes, causing an uncaught error in console. Normally this doesn't affect functionality (at least in the gateways I saw this showing up) but all errors are raised to the developer. Still, it should be fixed:
```
Uncaught ReferenceError: module is not defined
at sv-wc-payment-gateway-token-editor.js?ver=1717151442:1:3213
```
Investigate fix (`/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php`):
```php
/**
* Load the editor scripts and styles.
*
* @since 4.3.0
*/
public function enqueue_scripts_styles() {
$screen = get_current_screen();
if ( ! $screen || ! in_array( $screen->id, [ 'profile', 'user-edit' ], true ) ) {
return;
}
//... rest of the method as is
```
hope this is helpful
cheers!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.