Fix issue #48 class Title and Html not found with mediawiki 1.44#49
Fix issue #48 class Title and Html not found with mediawiki 1.44#49malberts merged 1 commit intoProfessionalWiki:masterfrom
Conversation
📝 WalkthroughWalkthroughRefactors internal references to MediaWiki classes by adding use-imports for MediaWiki\Html\Html and MediaWiki\Title\Title, and replacing fully qualified \Html calls with imported Html. Adjusts a private method in JsonBuilder to accept Title instead of \Title and to use Html::element and Title::getFullURL(). No public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/JsonBuilder.php (2)
59-64: Headline rendering is fine; optionally show namespace.Consider using prefixed title for clarity across namespaces.
Apply within this method:
- $title->getText() + $title->getPrefixedText()Optional: If you want MW-native link rendering (skin classes, redlink handling), switch to LinkRenderer via MediaWikiServices, but that’s beyond this PR’s scope.
66-66: Remove dead commented code.Keeps the class clean and avoids confusion.
-// return DataValueFactory::getInstance()->newDataValueByItem( $subject->getWikiPage() )->getLongHTMLText( smwfGetLinker() );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/JsonBuilder.php(2 hunks)src/TimelinePresenter.php(3 hunks)
🔇 Additional comments (4)
src/TimelinePresenter.php (3)
13-13: Importing Html via namespace — LGTM.
65-72: Switch to Html::rawElement for script tag — LGTM.Matches the new import and preserves previous behavior.
79-93: Html helpers for container elements — LGTM.Consistent with the new import; no functional change.
src/JsonBuilder.php (1)
10-11: Correct move to namespaced MediaWiki classes — imports present and no legacy globals remain.src/JsonBuilder.php and src/TimelinePresenter.php import MediaWiki\Title\Title and MediaWiki\Html\Html; ripgrep found no remaining \Title or Html:: usages. extension.json requires MediaWiki >= 1.39.0.
|
IMO we'd have been slightly better of delaying this change for a year or two, but whatever. Why: https://www.entropywins.wtf/blog/2025/08/20/why-you-should-use-mediawiki-lts-versions/ |
See Issue #48
namespaces added
Summary by CodeRabbit