PRESIDECMS-3248 admin bootbox modal js error#1751
PRESIDECMS-3248 admin bootbox modal js error#1751pixl8-brayden wants to merge 4 commits intostablefrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Hash-based bootbox modals broken by early href replacement
- Modal config initialization now derives hash and AJAX URL from the preserved link target (
data('href')fallback) so fragment-based bootbox links open inline content correctly.
- Modal config initialization now derives hash and AJAX URL from the preserved link target (
Or push these changes by commenting:
@cursor push 8c6f466b6e
Preview (8c6f466b6e)
diff --git a/system/assets/js/admin/presidecore/preside.bootbox.modal.js b/system/assets/js/admin/presidecore/preside.bootbox.modal.js
--- a/system/assets/js/admin/presidecore/preside.bootbox.modal.js
+++ b/system/assets/js/admin/presidecore/preside.bootbox.modal.js
@@ -37,7 +37,7 @@
initModalConfig = function( callback ){
var buttonList = ( $modalLink.data( "buttons" ) || "ok cancel" ).split( " " )
- , config, i, setupConfig;
+ , config, i, setupConfig, modalHref;
setupConfig = function( content ){
config = $.extend( {
@@ -71,12 +71,14 @@
callback( config );
};
- if ( $modalLink.get(0).hash.length ) {
- setupConfig( $( $modalLink.get(0).hash ).html() );
+ modalHref = $modalLink.data( "href" ) || $modalLink.attr( "href" ) || "";
+
+ if ( modalHref.charAt( 0 ) === "#" ) {
+ setupConfig( $( modalHref ).html() );
} else {
$.ajax( {
method : "GET"
- , url : $modalLink.data( 'href' )
+ , url : modalHref
, cache : false
, success : function( content ){ setupConfig( content ); }
} );This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 17. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |

Note
Low Risk
Low risk, localized to admin modal link handling; main risk is regressions if callers rely on the original
hrefremaining on the anchor element.Overview
Fixes bootbox modal initialization to stop relying on the anchor’s live
href/.hash, instead caching the original URL indata-hrefand using it to resolve#fragmentinline content or perform the modal content AJAX request.The click delegate now rewrites modal trigger links to
javascript:void(0)after caching the originalhref, preventing subsequent JS errors from mutated/emptyhrefvalues.Written by Cursor Bugbot for commit 1cb9dc7. This will update automatically on new commits. Configure here.