Skip to content

feat: Namespace FriendsOfREDAXO/ActivityLog, Bugfixes & Dependency-Updates (v1.0.0-beta1) - #47

Merged
skerbis merged 24 commits into
masterfrom
feat/namespace-friendsofredaxo
Mar 6, 2026
Merged

feat: Namespace FriendsOfREDAXO/ActivityLog, Bugfixes & Dependency-Updates (v1.0.0-beta1)#47
skerbis merged 24 commits into
masterfrom
feat/namespace-friendsofredaxo

Conversation

@skerbis

@skerbis skerbis commented Mar 6, 2026

Copy link
Copy Markdown
Member

Zusammenfassung

Dieses PR bringt die lang geplante Code-Modernisierung auf Basis der offenen Issues sowie verschiedene Bugfixes und aktualisierte Abhängigkeiten.


Änderungen

🏷️ Namespace-Migration (#38)

Alle Klassen wurden in den Namespace FriendsOfREDAXO\ActivityLog\ verschoben, wie es für FriendsOfREDAXO-Addons üblich ist:

Alt Neu
rex_activity FriendsOfREDAXO\ActivityLog\Activity
rex_activity_log_cronjob FriendsOfREDAXO\ActivityLog\ActivityLogCronjob
activity_clear FriendsOfREDAXO\ActivityLog\ActivityClear
RexActivity\EP\* FriendsOfREDAXO\ActivityLog\EP\*

Abwärtskompatibilität: Alle alten Klassennamen bleiben als leere BC-Stubs erhalten (class rex_activity extends Activity {}), bestehender Code funktioniert weiterhin.

🐛 Fix: clang_id Undefined array key (#46)

In EP\Meta wurde $params['clang_id'] ohne Existenzprüfung verwendet. Jetzt wird rex_clang::getCurrentId() als sicherer Fallback genutzt.

🐛 Fix: rex_sql_exception beim Löschen von Artikeln/Kategorien

Beim Auslösen von ART_DELETED/CAT_DELETED wurde rex_article::get()/rex_category::get() aufgerufen, obwohl der Datensatz bereits gelöscht war – das kollidierte mit dem noch laufenden DELETE-Statement in service_article.php. Die DB-Abfrage wird beim Typ delete nun vollständig übersprungen.

✅ Keine Logs für Admins (#31)

Die bereits implementierte Option disable_for_admins ist jetzt offiziell Teil der neuen Activity-Klasse und sauber dokumentiert.

📦 Dependency-Updates (ersetzt PRs #41#45)

  • phpunit/phpunit 9.6.21 → 9.6.34 (CVE-2026-24765)
  • nightwatch 3.6.2 → 3.15.0
  • lodash 4.17.21 → 4.17.23
  • geckodriver 3.0.2 → 6.1.0

Closes / References

Closes #38, Closes #46, References #31


Checklist

  • Neue Klassen unter FriendsOfREDAXO\ActivityLog\
  • BC-Stubs für alle alten Klassennamen
  • use-Statements in boot.php
  • package.yml auf v1.0.0-beta1
  • CHANGELOG.md hinzugefügt
  • Bugfix clang_id (meta.php Undefined array key "clang_id" #46)
  • Bugfix rex_sql_exception beim Löschen
  • Dependencies aktualisiert

skerbis added 4 commits March 6, 2026 17:41
…g_id (#46)

- Neue Klassen unter FriendsOfREDAXO\ActivityLog\ und FriendsOfREDAXO\ActivityLog\EP\
- BC-Stubs für alle alten Klassen (rex_activity, RexActivity\EP\*) via extends
- boot.php nutzt use-Statements statt globale FQN-Instantiierung
- rex_cronjob_manager::registerType() nutzt ActivityLogCronjob::class
- fix: Undefinierter Array-Key clang_id in Meta-EP fallback auf rex_clang::getCurrentId()
- Alle EP-Callbacks nutzen static::class statt hardcoded String
- Version 0.2.0
- phpunit/phpunit 9.6.21 -> 9.6.34 (behebt CVE-2026-24765, schließt #45)
- lodash 4.17.21 -> 4.17.23 (schließt #44)
- nightwatch 3.6.2 -> 3.15.0 (schließt #41, #43)
- geckodriver 3.0.2 -> 6.1.0 (schließt #42)
rex_article::get() und rex_category::get() dürfen beim delete-Typ nicht
aufgerufen werden – das Objekt ist zu dem Zeitpunkt bereits aus der DB
entfernt. Der interne SQL-Query kollidierte mit dem noch laufenden
DELETE-Statement in service_article.php und warf eine rex_sql_exception
(Unable to fetch row for statement).

Lösung: Early-return bei type === 'delete', DB-Lookup vollständig überspringen.
Copilot AI review requested due to automatic review settings March 6, 2026 16:56

Copilot AI left a comment

Copy link
Copy Markdown

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 modernizes the addon by migrating core functionality into the FriendsOfREDAXO\ActivityLog\* namespace (with backward-compatible stubs), applies targeted bugfixes in extension-point handlers, and updates PHP/Node tooling dependencies in preparation for v1.0.0-beta1.

Changes:

  • Introduces new namespaced core classes (Activity, ActivityClear, ActivityLogCronjob) and new EP handlers under FriendsOfREDAXO\ActivityLog\EP\*.
  • Replaces prior implementations with BC stubs (old class names now extend the new namespaced classes/traits).
  • Updates dependency versions (Composer + npm) and adds CHANGELOG.md.

Reviewed changes

Copilot reviewed 36 out of 38 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
package.yml Bumps addon version and switches console command mapping to the new namespaced command class.
package.json Updates Nightwatch/Geckodriver/Lodash dependency placement and versions for e2e tooling.
boot.php Boots the new namespaced EP registry and registers the new cronjob type class.
lib/Activity.php New namespaced Activity core (logging, callbacks, clearEntries).
lib/ActivityClear.php New namespaced console command implementation.
lib/ActivityLogCronjob.php New namespaced cronjob implementation.
lib/EP/ActivityExtensionPoints.php New EP “registry” that instantiates all EP handlers (incl. optional YForm).
lib/EP/EpTrait.php New shared trait for registering extension points and writing Activity logs.
lib/EP/Article.php New EP handler for article events, including delete handling behavior change.
lib/EP/Category.php New EP handler for category events, including delete handling behavior change.
lib/EP/Clang.php New EP handler for language events.
lib/EP/Media.php New EP handler for media events.
lib/EP/Meta.php New EP handler for meta updates with clang fallback to address missing clang_id.
lib/EP/Module.php New EP handler for module events.
lib/EP/Slice.php New EP handler for slice events with safer clang fallback and more defensive lookups.
lib/EP/Template.php New EP handler for template events.
lib/EP/User.php New EP handler for user events.
lib/EP/Yform.php New EP handler for YForm manager events (conditional activation).
lib/rex_activity.php BC stub: rex_activity now extends the namespaced Activity.
lib/rex_activity_log_cronjob.php BC stub: rex_activity_log_cronjob now extends the namespaced cronjob.
lib/console.php BC stub: activity_clear now extends the namespaced console command.
lib/rex_activity_extension_points.php BC stub: old EP registry now extends the new EP registry.
lib/extension_points/article.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/category.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/clang.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/ep_trait.php BC stub: old trait now composes the new namespaced trait.
lib/extension_points/media.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/meta.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/module.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/slice.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/template.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/user.php BC stub: old EP handler class now extends the new namespaced handler.
lib/extension_points/yform.php BC stub: old EP handler class now extends the new namespaced handler.
composer.json Updates PHPUnit constraint to the newer 9.6.x line.
composer.lock Locks updated dev dependencies consistent with the PHPUnit bump.
CHANGELOG.md Adds release notes for 1.0.0-beta1 documenting migration and fixes.

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

Comment thread package.json
Comment thread lib/EP/Article.php Outdated
Comment thread lib/EP/Clang.php Outdated
Comment thread lib/EP/Slice.php
Comment thread lib/EP/Template.php Outdated
Comment thread lib/EP/Category.php
Comment thread lib/EP/Module.php Outdated
Comment thread lib/EP/User.php Outdated
Comment thread lib/EP/Meta.php
Comment thread lib/EP/Clang.php Outdated
skerbis added 3 commits March 6, 2026 18:22
…tenz (#17/#21)

- DB: source VARCHAR(191) nullable in install.php + update.php
- Activity::source() Methode + sourceListCallback
- EpTrait: getSource() + source in logExtensionPoint()
- Alle EP-Handler: getSource() gibt Quelle zurück (article/category/...)
- Filter-Formular: Suche, Typ, Quelle, User als Bootstrap-3-Row, Selectpicker
- Filter-Persistenz: list->addParam() für Pager, Hidden-Inputs in Lösch-Form
- SCSS: Zeilenfarben nach Log-Level, Source-Badges mit eigenen Farben, Dark Mode
- Sprachdateien: neue Keys für Spalten, Suche, Filter
- README: source() dokumentiert
- CHANGELOG aktualisiert
@skerbis
skerbis merged commit 582fa09 into master Mar 6, 2026
3 checks passed
@skerbis
skerbis deleted the feat/namespace-friendsofredaxo branch March 6, 2026 18:38
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.

meta.php Undefined array key "clang_id" Namespace FOR-konform anpassen

2 participants