Skip to content

PRESIDECMS-3248 admin bootbox modal js error#1751

Open
pixl8-brayden wants to merge 4 commits intostablefrom
feature-PRESIDECMS-3248_admin-bootbox-modal-js-error
Open

PRESIDECMS-3248 admin bootbox modal js error#1751
pixl8-brayden wants to merge 4 commits intostablefrom
feature-PRESIDECMS-3248_admin-bootbox-modal-js-error

Conversation

@pixl8-brayden
Copy link
Contributor

@pixl8-brayden pixl8-brayden commented Mar 12, 2026

Note

Low Risk
Low risk, localized to admin modal link handling; main risk is regressions if callers rely on the original href remaining on the anchor element.

Overview
Fixes bootbox modal initialization to stop relying on the anchor’s live href/.hash, instead caching the original URL in data-href and using it to resolve #fragment inline content or perform the modal content AJAX request.

The click delegate now rewrites modal trigger links to javascript:void(0) after caching the original href, preventing subsequent JS errors from mutated/empty href values.

Written by Cursor Bugbot for commit 1cb9dc7. This will update automatically on new commits. Configure here.

@github-actions
Copy link

Test Results

    1 files  ±0    117 suites  ±0   2m 8s ⏱️ -37s
1 829 tests ±0  1 826 ✅ ±0  3 💤 ±0  0 ❌ ±0 
1 832 runs  ±0  1 829 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit fb1473c. ± Comparison against base commit 88a5be4.

@github-actions
Copy link

Test Results

    1 files  ±0    117 suites  ±0   2m 23s ⏱️ -22s
1 829 tests ±0  1 826 ✅ ±0  3 💤 ±0  0 ❌ ±0 
1 832 runs  ±0  1 829 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit fb1473c. ± Comparison against base commit 88a5be4.

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Test Results

    1 files  ±0    117 suites  ±0   2m 40s ⏱️ -5s
1 829 tests ±0  1 826 ✅ ±0  3 💤 ±0  0 ❌ ±0 
1 832 runs  ±0  1 829 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit bdab6d5. ± Comparison against base commit 88a5be4.

♻️ This comment has been updated with latest results.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

Create PR

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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

@cursor
Copy link

cursor bot commented Mar 12, 2026

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.

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.

1 participant