Skip to content

Use namespaced Semantic MediaWiki classes#905

Closed
alistair3149 wants to merge 4 commits into
masterfrom
drop-smw6-modernize-classes
Closed

Use namespaced Semantic MediaWiki classes#905
alistair3149 wants to merge 4 commits into
masterfrom
drop-smw6-modernize-classes

Conversation

@alistair3149

Copy link
Copy Markdown
Member

First piece of the 13.0.0 cycle (Semantic MediaWiki 7 only).

What

Replaces every deprecated Semantic MediaWiki class alias Maps used with its SMW 7 canonical namespaced class:

  • Global aliases: SMWDataValueSMW\DataValues\DataValue, SMWDIGeoCoordSMW\DataItems\GeoCoord, SMWDataItemSMW\DataItems\DataItem, SMWOutputsSMW\MediaWiki\Outputs, SMWDIContainerSMW\DataItems\Container, SMWDIBlobSMW\DataItems\Blob, SMWWikiPageValueSMW\DataValues\WikiPageValue, SMWRecordValueSMW\DataValues\RecordValue.
  • Namespaced aliases: SMW\DIPropertySMW\DataItems\Property, SMW\DIWikiPageSMW\DataItems\WikiPage.
  • Inline FQN uses are converted to use imports; @see docblocks point at the canonical classes.

These aliases are @deprecated in Semantic MediaWiki 7 and slated for removal in a future major. Semantic Maps already requires Semantic MediaWiki 7 (the 12.1.x line uses SMW-7-only APIs such as SMW\EventDispatcher\EventDispatcher and SMWOutputs::requireStyle()), so this is internal cleanup with no behavior change.

Verification

Against MediaWiki 1.43 + Semantic MediaWiki 7.0: full suite OK (265 tests, 449 assertions); every renamed class resolves; no new PHPCS violations under Maps' ruleset.

Notes

  • Builds on Support Semantic MediaWiki 7 #904 (the 12.1.6 fatal fix); its commits drop out of this diff once Support Semantic MediaWiki 7 #904 merges.
  • No version bump or release-note entry here — the repo has no convention for tagging in-development versions, so the 13.0.0 bump and the "requires Semantic MediaWiki 7 / dropped 6" release note belong with the eventual release that also carries the rest of the 13.0.0 breaking changes.

CoordinateValue::getLongWikiText() registered the predefined tooltip head
item via the `SMW_HEADER_TOOLTIP` constant, which Semantic MediaWiki 7.0
removed. Under PHP 8 the undefined constant raises a fatal error on every
long-text or tooltip render of a coordinate value (factbox, #show,
Special:Browse, query result popups).

Load the tooltip resource modules directly instead, matching how Semantic
MediaWiki 7 itself loads them, and add a regression test for the long text
and tooltip output.
The CI install only loaded Maps, so every test guarded on Semantic
MediaWiki being present self-skipped and the entire Semantic MediaWiki
integration went unverified. Add an optional Semantic MediaWiki argument
to the install script (loaded before Maps, with its schema set up) and a
matrix row that installs Semantic MediaWiki 7, so those tests actually run.
Replace the deprecated global Semantic MediaWiki class aliases (SMWDataValue,
SMWDIGeoCoord, SMWDataItem, SMWOutputs, SMWDIContainer, SMWDIBlob,
SMWWikiPageValue, SMWRecordValue) and the deprecated namespaced aliases
(SMW\DIProperty, SMW\DIWikiPage) with their Semantic MediaWiki 7 canonical
namespaced classes. These aliases are deprecated in Semantic MediaWiki 7 and
slated for removal, and Semantic Maps already requires Semantic MediaWiki 7.
@alistair3149

Copy link
Copy Markdown
Member Author

Consolidated into #904 — the namespace modernization now rides in the single 12.1.6 Semantic MediaWiki 7 PR.

@alistair3149 alistair3149 deleted the drop-smw6-modernize-classes branch June 5, 2026 21:29
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