Skip to content

fix: Popup window name can contain more than one "__"#1575

Merged
fsbraun merged 1 commit intomasterfrom
fix/pop-management
Feb 6, 2026
Merged

fix: Popup window name can contain more than one "__"#1575
fsbraun merged 1 commit intomasterfrom
fix/pop-management

Conversation

@fsbraun
Copy link
Member

@fsbraun fsbraun commented Feb 5, 2026

Description

The silent assumption that the popup window name only contains one set of dunder symbols (__) is broken, potentially by newer Django versions.

Now, only the last __ is cut from the pupup window name to find the widget it belongs to.

Related resources

  • #...
  • #...

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @fsbraun, your pull request is larger than the review limit of 150000 diff characters

@fsbraun fsbraun requested a review from vinitkumar February 5, 2026 23:32
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.98%. Comparing base (18c25fc) to head (2f2d655).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1575   +/-   ##
=======================================
  Coverage   76.98%   76.98%           
=======================================
  Files          78       78           
  Lines        3671     3671           
  Branches      498      498           
=======================================
  Hits         2826     2826           
  Misses        675      675           
  Partials      170      170           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fsbraun
Copy link
Member Author

fsbraun commented Feb 5, 2026

@sourcery-ai Ignore the bundle files for reviewing

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 5, 2026

Understood, I’ll ignore the bundle files when considering this PR and focus the review on the functional and source changes only.

Copy link

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 fixes a bug in the windowname_to_id function that parses popup window names. The function previously assumed window names contained only one set of double underscores (__), which could break with newer Django versions or complex naming patterns. The fix changes from using split('__')[0] to using lastIndexOf('__') with substring() to extract everything before the last occurrence of __.

Changes:

  • Updated windowname_to_id function to use lastIndexOf("__") instead of split("__")[0]
  • The bundled JavaScript file reflects this same change

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
filer/static/filer/js/addons/popup_handling.js Core fix: changed window name parsing to find the last __ occurrence
filer/static/filer/js/dist/admin-file-widget.bundle.js Bundled version containing the same fix

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

@fsbraun fsbraun merged commit 89c47a7 into master Feb 6, 2026
95 checks passed
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

Comments