Repository navigation
Fix JS Build Files Breaking Admin Interface - #2222
Merged
Merged
Conversation
Contributor
|
Unable to PHPCS or SVG scan one or more files due to error running PHPCS/SVG scanner:
The error may be temporary. If the error persists, please contact a human (commit-ID: 10af0c1). |
NoumaanAhamed
marked this pull request as ready for review
November 28, 2025 03:48
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes critical issues in the rtMedia admin dashboard that occurred after running npx grunt build. The build process was breaking the admin interface due to missing dependencies and JSON parsing errors.
Key Changes:
- Added
settings.jsto the Grunt build configuration to ensure it's included inadmin.min.js - Fixed script dependency loading for
tabs.js(rtTab jQuery plugin) to prevent console errors - Added defensive type checking before JSON parsing to avoid parsing already-parsed AJAX responses
Reviewed changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Gruntfile.js | Added settings.js to both the terser backend build configuration and watch task to ensure it's properly included in admin.min.js |
| app/admin/RTMediaAdmin.php | Fixed script enqueuing by always loading tabs.js and adding it as a dependency to admin scripts, ensuring the rtTab plugin is available |
| app/assets/admin/js/settings.js | Added early return after import/export AJAX responses and type checking before JSON.parse() to prevent parsing errors |
| app/assets/js/rtmedia.min.js | Rebuilt frontend minified file with updated source code |
| app/assets/js/admin-upload-terms.min.js | Rebuilt admin upload terms minified file |
| app/assets/admin/js/rtmedia-admin.min.js | Rebuilt admin minified file (removed debug console.log) |
| app/assets/admin/js/admin.min.js | Rebuilt admin minified file with settings.js included and additional bug fix for wp_nonce |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
KMchaudhary
approved these changes
Dec 3, 2025
KMchaudhary
left a comment
Contributor
There was a problem hiding this comment.
Reviewed and tested the PRs; they satisfy all the testing instructions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Fix Dashboard Build Files Breaking Admin Interface
Description
This PR fixes the root cause issues that were causing the rtMedia admin dashboard to break when running
npx grunt buildas per #2214Solves #2224
Problem
After running
npx grunt build, the admin settings page was broken:rtTab is not a function,"[object Object]" is not valid JSONSolution
Fixed multiple issues in the source JavaScript files and build configuration:
settings.jsto the backend build (was missing fromadmin.min.js)tabs.jsdependency loading for admin scriptsChanges
Gruntfile.jssettings.jstoterser.backend.filesarraysettings.jsapp/admin/RTMediaAdmin.phprtmedia-admin-tabsscriptapp/assets/admin/js/settings.jsJSON.parse()to prevent parsing already-parsed objectsTesting Instructions
npx grunt buildRelated Issues
Fixes the root cause of the dashboard build issue that required reverting to v4.7.4 build files.