Skip to content

Add MediaPlace support to media-picker widgets - #441

Merged
skerbis merged 2 commits into
mainfrom
feature/mediaplace-widget-support
Aug 28, 2026
Merged

Add MediaPlace support to media-picker widgets#441
skerbis merged 2 commits into
mainfrom
feature/mediaplace-widget-support

Conversation

@skerbis

@skerbis skerbis commented Aug 27, 2026

Copy link
Copy Markdown
Member

Zusammenfassung

  • Custom-Link (Einzelmedium + Vorschau-Button), das Medialisten-Widget (REX_MEDIALIST/REX_CUSTOM_MEDIALIST, Aktionen „Öffnen"/„Hinzufügen"/„Ansehen") und das ältere Bilderlisten-Widget öffnen jetzt automatisch das MediaPlace-Overlay statt des klassischen Medienpool-Popups bzw. der Upload-Seite, sofern MediaPlace installiert und aktiv ist.
  • Ohne MediaPlace ändert sich nichts – die klassischen Popups bleiben der unveränderte Fallback.
  • Neue zentrale assets/js/mediaplace-bridge.js (window.rex5MediaplaceBridge) – gleiches Prinzip wie bei den tinymce-/cke5-AddOns, hier aber an einer Stelle definiert und von allen drei Widget-Skripten genutzt statt dupliziert.
  • Eine konfigurierte types="jpg,png"-Beschränkung bleibt weiterhin hart durchgesetzt: MediaPlace bekommt in 1.3.6 eine neue MP3.open()-Option allowedExtensions, die nicht passende Dateien komplett aus dem Grid ausblendet und die Auswahl blockiert (statt nur den Start-Tab zu setzen, wie es filter schon vorher tat). Ohne MediaPlace ≥1.3.6 filtert die alte, weichere filter-Option weiterhin nur den Start-Tab.
  • Version 9.3.2 → 9.4.0, CHANGELOG.md und docs/00_whats_new.md aktualisiert.

Test-Plan

  • node --check auf allen JS-Dateien
  • php -l auf boot.php
  • Lokal deployed und Backend-Login/-Laden ohne neue Fehler im System-Log geprüft
  • allowedExtensions-Filterlogik isoliert mit Node getestet (Groß-/Kleinschreibung, Whitelist/kein Filter)
  • Manuelles Durchklicken in einer Instanz mit aktivem MediaPlace ≥1.3.6 (Custom-Link, Medialisten-Widget open/add/view, altes Imglist-Widget, inkl. types=-Einschränkung) – bitte vor Merge gegenprüfen

🤖 Generated with Claude Code

Custom-Link, the medialist widget (REX_MEDIALIST/REX_CUSTOM_MEDIALIST),
and the older imglist widget now detect an active MediaPlace addon and
open its overlay instead of the classic mediapool popup/upload pages.
Falls back to unchanged classic behavior when MediaPlace isn't active.

Detection/picking logic lives in a new shared assets/js/mediaplace-bridge.js
(window.rex5MediaplaceBridge), mirroring the same pattern already used by
the tinymce and cke5 addons, so all three widget scripts share one
definition instead of duplicating it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bfb42a8-67d1-4dce-92fe-d5a285e48053

📥 Commits

Reviewing files that changed from the base of the PR and between 71d0559 and 7a7f1fd.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • assets/js/customlink.js
  • assets/js/imglist.js
  • assets/js/list-widget.js
  • assets/js/mediaplace-bridge.js
  • boot.php
  • docs/00_whats_new.md
  • package.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Moin. Version 9.4.0 ergänzt eine zentrale MediaPlace-Bridge. Custom-Link-, Bilderlisten- und Medialisten-Widgets nutzen bei aktivem MediaPlace das Overlay. Ohne MediaPlace bleiben die bisherigen REX-Popups aktiv.

Changes

MediaPlace-Unterstützung für Medien-Widgets

Layer / File(s) Summary
Bridge und Asset-Einbindung
assets/js/mediaplace-bridge.js, boot.php
Die Bridge prüft MediaPlace, startet Auswahl und Vorschau über MP3 und verarbeitet Medienfilter. Das Backend bindet die Bridge ein.
Widget-Auswahl und Vorschau
assets/js/customlink.js, assets/js/imglist.js, assets/js/list-widget.js
Die drei Medien-Widgets verwenden die Bridge für Auswahl und Vorschau. Die Bilder- und Medialisten-Widgets übernehmen Mehrfachauswahlen als Optionen. Ohne aktive Bridge bleibt der REX-Ablauf bestehen.
Versionierung und Dokumentation
package.yml, CHANGELOG.md, docs/00_whats_new.md
Die Paketversion wird auf 9.4.0 erhöht. Changelog und Dokumentation beschreiben die MediaPlace-Unterstützung und den Fallback.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7a7f1

When MediaPlace is active, the affected widgets use the overlay and otherwise retain existing behavior. No concrete user-impacting defect or merge-blocking risk remains, so the change is merge-ready after normal checks.

Sequence Diagram(s)

sequenceDiagram
  participant RedaxoBackend
  participant MedienWidget
  participant rex5MediaplaceBridge
  participant MP3
  RedaxoBackend->>MedienWidget: lädt mediaplace-bridge.js
  MedienWidget->>rex5MediaplaceBridge: isActive()
  MedienWidget->>rex5MediaplaceBridge: pick(callback, filter)
  rex5MediaplaceBridge->>MP3: open(options)
  MP3-->>MedienWidget: ausgewählte Dateien
  MedienWidget->>MedienWidget: aktualisiert Optionen und Vorschau
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Der Titel beschreibt die zentrale Änderung präzise: Die MediaPlace-Unterstützung für Medien-Picker-Widgets wird ergänzt.
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/mediaplace-widget-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

MediaPlace's options.filter is only a starting tab, not a hard
restriction -- a configured types="jpg,png" widget config would
silently stop being enforced once MediaPlace took over the picker.
Wire the new MP3.open() allowedExtensions option (mediaplace >=1.3.6)
through all three widgets so the restriction still holds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@skerbis
skerbis merged commit 921ca91 into main Aug 28, 2026
6 of 7 checks passed
@skerbis
skerbis deleted the feature/mediaplace-widget-support branch August 28, 2026 10:35
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