Skip to content

Upstream - #11

Closed
ZoruaFox wants to merge 32 commits into
masterfrom
upstream
Closed

Upstream#11
ZoruaFox wants to merge 32 commits into
masterfrom
upstream

Conversation

@ZoruaFox

@ZoruaFox ZoruaFox commented May 7, 2026

Copy link
Copy Markdown
Member

No description provided.

paladox and others added 30 commits April 3, 2026 19:19
* Add CI for MW 1.43+ and remove MW 1.39

* Update extension.json

* Update ci.yml

* Update ci.yml

* Update GalleryTest.php

* Update TreeTest.php

* Update TreeResultPrinter.php

* Update TreeTest.php

* Update SRF_Dygraphs.php

* Update Carousel.php

* Update MediaPlayer.php

* Update SRF_Calendar.php

* Update SRF_JitGraph.php

* Update SRF_SlideShowApi.php

* Update SpreadsheetPrinter.php

* Update SRF_Process.php

* Update MapView.php

* Update SRF_D3Chart.php

* Update TagCloud.php

* Update Filtered.php

* Update SRF_Timeline.php

* Update SRF_Incoming.php

* Update SRF_SlideShow.php

* Update GraphFormatter.php

* Update EventCalendar.php

* Update Gallery.php

* Update GanttPrinter.php

* Update SRF_Dygraphs.php

* Update SemanticResultFormats.utils.php

* Update SRF_PageWidget.php

* Update TableView.php

* Update SRF_Boilerplate.php

* Update SRF_jqPlotChart.php

* Update SRF_Timeseries.php

* Update GraphPrinter.php

* Update SRF_Sparkline.php

* Update DataTables.php

* Update SRF_jqPlotSeries.php

* Update SRF_ListWidget.php

* Update SRF_ValueRank.php

* Update GalleryTest.php

* Update ValueRankTest.php

* Update ListTreeBuilderTest.php

* Update ResourceFormatterTest.php

* Update TemplateBuilderTest.php

* Update OutlineResultPrinterTest.php

* Update I18nJsonFileIntegrityTest.php

* Update JsonTestCaseScriptRunnerTest.php

* Update BibTexFileExportPrinter.php

* Update BibTexFileExportPrinter.php

* Fix

* Update ci.yml

* Update ci.yml

* Fix

* Fix
With the droppage of MW 1.39 and the requirement of at least MW 1.43+ now. Let's bump the version to 6.0.0.
* do not include ext.srf.filtered.leaflet.js

see SemanticMediaWiki#976

* add stripHtml

* Add files via upload

add compiled
* Create af.json

* add i18n files

* add i18n plugins

* use language plugins

* fix retrieve language lowercase

* improve retrieve language

* fix comment

* fix closure

* improve retrieveLanguage
- Add XML declaration and schema reference (phpunit.de/9.6)
- Remove deprecated attributes: backupStaticAttributes, cacheTokens
- Replace <filter><whitelist> with <coverage><include>
* chore(qa): add Phan static analysis

- Add mediawiki/mediawiki-phan-config 0.14.0 to require-dev
- Add phan Composer script (--allow-polyfill-parser)
- Add .phan/config.php covering formats/ and src/
- Add initial .phan/baseline.php capturing all existing violations
- Add composer-phan Makefile target
- Add Phan step to coverage job in ci.yml

Closes SemanticMediaWiki#1006

* fix(ci): exclude auto-generated .phan/baseline.php from PHPCS
…emanticMediaWiki#1010) (SemanticMediaWiki#1011)

Base class View::getJsDataForRow() returned null in the implementation
but subclasses (CalendarView, MapView) widen the return type to array|null.
Correct the @return docblock on the base class to array|null so Phan
no longer flags the signature mismatch in CalendarView.
MediaWiki's evolution of its gallery HTML structure forces SRF to adapt.

MediaWiki has adopted a "mw-file-description" HTML class as more semantic
and specific for file description links in gallery displays. It  replaces
the former, generic, "image" class applied to the same elements.

So, Semantic Result Formats - Gallery output needs to adapt specifically
in its "overlay" and "redirect" options because they relied upon the old
HTML output of MediaWiki.

- modifies the JavaScript files for overlay and redirect
- Adds QUnit tests for overlay and redirect with assertions about the
  HTML
- Fixup to the 'fancybox' jQuery module (without upgrading)

If running this in a containerized / development environment, you can
test only gallery-related functionality
"cd /var/www/html/extensions/SemanticResultFormats && composer phpunit -- --filter Gallery"

Fixes Issue SemanticMediaWiki#940 with explanation by @ADB-Linux
…iaWiki#1012) (SemanticMediaWiki#1013)

Replace weak == comparisons with strict === in Gallery.php:
- widget param: == 'carousel' / == 'slideshow' -> ===
- class/widget ternary truthiness -> !== ''
- overlay param: == true -> direct boolean
- getNamespace() == NS_FILE -> ===
- gettype($ig->mParser) == "object" -> is_object()
- empty($imgCaption) -> $imgCaption === '' + remove dead else branch

Add PHPUnit tests covering the carousel, slideshow, overlay and
custom-class code paths.
…nPluginSimplifyExpressionBool in DataTables (SemanticMediaWiki#1014) (SemanticMediaWiki#1015)

- data-nocase: $x === $y ? true : false -> direct boolean expression
- getPrintoutsOptions 'number' case: $value * 1 -> (float)$value

Add JSONScript integration test (datatables-02.json) covering
the number/boolean printout parameter casting code paths.
…des (SemanticMediaWiki#1017)

- Replace assertEmpty() with assertSame([], ...) in OutlineTreeTest
- Move inline comments to their own line in SRF_Array, QuerySegmentListProcessor, SRF_Process
- Remove MediaWiki.PHPUnit.AssertEmpty.AssertEmptyUsed exclude
- Remove MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment exclude

Closes SemanticMediaWiki#1016
…oltip.add() (SemanticMediaWiki#779, SemanticMediaWiki#1018) (SemanticMediaWiki#1020)

* test(dygraphs): add JSONScript integration test and fix AssignmentInCondition (SemanticMediaWiki#1018)

* fix(dygraphs): replace deprecated tooltip.add() with tippy-compatible DOM injection (SemanticMediaWiki#779)

* fix(utils): drop deprecated DummyLinker/Linker, pass null to getText()
…spreadsheet, jqplot, googlecharts, dataframe, prolog + CI bump (SemanticMediaWiki#1018) (SemanticMediaWiki#1021)

* fix(calendar): remove mFirstCall dead code, simplify getParser() usage

* test(formats): add JSONScript integration tests for array, calendar, spreadsheet, jqplot, googlecharts, dataframe, prolog (SemanticMediaWiki#1018)

* chore(ci): bump SMW_VERSION to dev-master, add spreadsheet install step

SMW 6.0.1 has a bug where #ask returns empty results in the
prepareContentForEdit context used by JSONScript parser-type tests.
Fixed in dev-master; pin to 7.x once released.

* chore(ci): enable googlebar/googlepie in __setup_extension__ for integration tests

* fix(spreadsheet): add null guard for CellIterator::current() (phan PhanTypeMismatchArgumentNullable)
…diaWiki#1018) (SemanticMediaWiki#1022)

* fix(phpcs): resolve AssignmentInCondition global excludes (SemanticMediaWiki#1018)

- Rewrite while-assignment loops in tested formats (array, spreadsheet,
  jqplot, googlecharts, dataframe, calendar, prolog) to use explicit
  pre-condition assignment pattern
- Add phpcs:ignore per-line for untested formats (gallery, Gantt,
  timeseries, tagcloud, JitGraph, datatables, time, boilerplate,
  valuerank, timeline, filtered, tree, media, math) and src/ classes
  (Outline, BibTex, iCalendar, Graph, vCard)
- Remove global excludes FoundInWhileCondition and Found from .phpcs.xml

* fix(phan): resolve PhanUndeclaredVariable errors in JitGraph and MediaPlayer

- Initialize $firstcol = true at start of each row iteration in SRF_JitGraph
- Initialize $rowData = [] before inner while loop in MediaPlayer
- Add dev-test and .git-safe-dir targets aligned with PageForms
- Hook composer-phan into ci-coverage target
SemanticMediaWiki#1023)

* fix(ci): install symfony/css-selector to enable parser-html JSONScript tests

SMW declares symfony/css-selector in require-dev, but MediaWiki's
composer-merge-plugin runs with merge-dev: false, so SMW's dev
dependencies are never installed into the shared MW vendor. This causes
HtmlValidator::canUse() to return false, marking all "type": "parser-html"
test cases as incomplete (∅).

Add install-html-validator Makefile target (parallel to install-spreadsheet)
that installs symfony/css-selector via composer.local.json. Chain it into
the install target so it runs after every make install.

Effect: filtered-01.json (18 tests, 55 assertions) and filtered-02.json
(1 test, 8 assertions) now execute fully. Also unblocks gantt-01/02,
tree-01/02/04/06/07, gallery-03, listwidget-01, valuerank-01.

* fix(filtered): NumberFilter accepted all property types due to missing === comparison

isValidFilterForPropertyType() contained `|| '_dat'` instead of
`|| $typeID === '_dat'`. A non-empty string is always truthy in PHP,
so the filter was accepted for every property type (e.g. _txt, _wpg).

Add NumberFilterTest with cases for _num, _qty, _dat (true) and
_txt, _wpg (false) to document and guard the correct behaviour.

* fix(filtered): ResultItem::getData() triggers undefined array key on missing id

getData() accessed $this->mItemData[$viewOrFilterId] directly.
On PHP 8.x this throws an "Undefined array key" error when the
key has not been set (e.g. after unsetData() or for a new item).

Fix: use null-coalescing operator (?? null).

Add three tests to ResultItemTest: getData on unset key, on set
value, and after explicit unsetData().
…Wiki#1025)

* refactor(filtered): cleanup dead code and style issues (SemanticMediaWiki#1024)

F-03: remove duplicate SMWOutputs::requireResource call and redundant
      registerResources([], [...]) in Filtered::getResultText()

F-06: simplify $GLOBALS access in MapView getters using ?? operator;
      fix @param null docblocks on setMapProvider/setMapProviderDark
      to correctly declare string type

F-10/F-11: remove dead commented-out code blocks in CalendarView
           (ListView copy-paste remnant in handleParameters, stale
           wikitext debug line in getJsDataForRow)

F-14: replace array_map side-effect with foreach in
      Filtered::registerResourceModules()

F-16: remove obsolete 'return true' from Hooks handlers
      (MW 1.35+ ignores boolean hook return values)

* fix(phpcs): remove blank line before closing brace in CalendarView::handleParameters()
…stView (F-12) (SemanticMediaWiki#1031)

* refactor(filtered): lazy-init handleParameters() via null-guard in ListView (F-12)

* fix(filtered): extract $mSep property to resolve Phan nullable array-access warnings (F-12)
Copilot AI review requested due to automatic review settings May 7, 2026 18:00

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 199 files, which is 49 over the limit of 150.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e7cb1f0-2528-4a39-b607-c9ba6af2ee2d

📥 Commits

Reviewing files that changed from the base of the PR and between a6f910b and d8f90b9.

⛔ Files ignored due to path filters (1)
  • formats/filtered/resources/js/ext.srf.filtered.js.map is excluded by !**/*.map
📒 Files selected for processing (199)
  • .github/workflows/ci.yml
  • .phan/baseline.php
  • .phan/config.php
  • .phpcs.xml
  • Makefile
  • SemanticResultFormats.utils.php
  • __setup_extension__
  • build
  • composer.json
  • extension.json
  • formats/Gantt/GanttPrinter.php
  • formats/JitGraph/SRF_JitGraph.php
  • formats/Prolog/PrologPrinter.php
  • formats/array/SRF_Array.php
  • formats/array/SRF_Hash.php
  • formats/boilerplate/SRF_Boilerplate.php
  • formats/calendar/EventCalendar.php
  • formats/calendar/SRF_Calendar.php
  • formats/carousel/Carousel.php
  • formats/d3/SRF_D3Chart.php
  • formats/dataframe/DataframePrinter.php
  • formats/datatables/DataTables.php
  • formats/datatables/QuerySegmentListProcessor.php
  • formats/datatables/i18n/Ganda.json
  • formats/datatables/i18n/af.json
  • formats/datatables/i18n/am.json
  • formats/datatables/i18n/ar.json
  • formats/datatables/i18n/az-AZ.json
  • formats/datatables/i18n/be.json
  • formats/datatables/i18n/bg.json
  • formats/datatables/i18n/bn.json
  • formats/datatables/i18n/bs-BA.json
  • formats/datatables/i18n/ca.json
  • formats/datatables/i18n/co.json
  • formats/datatables/i18n/cs.json
  • formats/datatables/i18n/cy.json
  • formats/datatables/i18n/da.json
  • formats/datatables/i18n/de-DE.json
  • formats/datatables/i18n/el.json
  • formats/datatables/i18n/en-GB.json
  • formats/datatables/i18n/eo.json
  • formats/datatables/i18n/es-AR.json
  • formats/datatables/i18n/es-CL.json
  • formats/datatables/i18n/es-CO.json
  • formats/datatables/i18n/es-ES.json
  • formats/datatables/i18n/es-MX.json
  • formats/datatables/i18n/et.json
  • formats/datatables/i18n/eu.json
  • formats/datatables/i18n/fa.json
  • formats/datatables/i18n/fi.json
  • formats/datatables/i18n/fil.json
  • formats/datatables/i18n/fr-FR.json
  • formats/datatables/i18n/ga.json
  • formats/datatables/i18n/gl.json
  • formats/datatables/i18n/gu.json
  • formats/datatables/i18n/he.json
  • formats/datatables/i18n/hi.json
  • formats/datatables/i18n/hr.json
  • formats/datatables/i18n/hu.json
  • formats/datatables/i18n/hy.json
  • formats/datatables/i18n/id-ALT.json
  • formats/datatables/i18n/id.json
  • formats/datatables/i18n/is.json
  • formats/datatables/i18n/it-IT.json
  • formats/datatables/i18n/ja.json
  • formats/datatables/i18n/jv.json
  • formats/datatables/i18n/ka.json
  • formats/datatables/i18n/kk.json
  • formats/datatables/i18n/km.json
  • formats/datatables/i18n/kn.json
  • formats/datatables/i18n/ko.json
  • formats/datatables/i18n/ku.json
  • formats/datatables/i18n/ky.json
  • formats/datatables/i18n/lo.json
  • formats/datatables/i18n/lt.json
  • formats/datatables/i18n/lv.json
  • formats/datatables/i18n/mk.json
  • formats/datatables/i18n/mn.json
  • formats/datatables/i18n/mr.json
  • formats/datatables/i18n/ms.json
  • formats/datatables/i18n/ne.json
  • formats/datatables/i18n/nl-NL.json
  • formats/datatables/i18n/no-NB.json
  • formats/datatables/i18n/no-NO.json
  • formats/datatables/i18n/pa.json
  • formats/datatables/i18n/pl.json
  • formats/datatables/i18n/ps.json
  • formats/datatables/i18n/pt-BR.json
  • formats/datatables/i18n/pt-PT.json
  • formats/datatables/i18n/rm.json
  • formats/datatables/i18n/ro.json
  • formats/datatables/i18n/ru.json
  • formats/datatables/i18n/si.json
  • formats/datatables/i18n/sk.json
  • formats/datatables/i18n/sl.json
  • formats/datatables/i18n/snd.json
  • formats/datatables/i18n/sq.json
  • formats/datatables/i18n/sr-SP.json
  • formats/datatables/i18n/sr.json
  • formats/datatables/i18n/sv-SE.json
  • formats/datatables/i18n/sw.json
  • formats/datatables/i18n/ta.json
  • formats/datatables/i18n/te.json
  • formats/datatables/i18n/tg.json
  • formats/datatables/i18n/th.json
  • formats/datatables/i18n/tk.json
  • formats/datatables/i18n/tk.mjs
  • formats/datatables/i18n/tr.json
  • formats/datatables/i18n/ug.json
  • formats/datatables/i18n/uk.json
  • formats/datatables/i18n/ur.json
  • formats/datatables/i18n/uz-CR.json
  • formats/datatables/i18n/uz.json
  • formats/datatables/i18n/vi.json
  • formats/datatables/i18n/zh-HANT.json
  • formats/datatables/i18n/zh.json
  • formats/datatables/resources/ext.srf.formats.datatables.js
  • formats/dygraphs/SRF_Dygraphs.php
  • formats/dygraphs/resources/ext.srf.dygraphs.js
  • formats/filtered/gulpfile.js
  • formats/filtered/resources/js/ext.srf.filtered.js
  • formats/filtered/resources/ts/Filtered/Filter/ValueFilter.ts
  • formats/filtered/src/Filtered.php
  • formats/filtered/src/Filters/NumberFilter.php
  • formats/filtered/src/Hooks.php
  • formats/filtered/src/ResultItem.php
  • formats/filtered/src/View/CalendarView.php
  • formats/filtered/src/View/ListView.php
  • formats/filtered/src/View/MapView.php
  • formats/filtered/src/View/TableView.php
  • formats/filtered/src/View/View.php
  • formats/gallery/Gallery.php
  • formats/gallery/resources/ext.srf.gallery.overlay.js
  • formats/gallery/resources/ext.srf.gallery.redirect.js
  • formats/googlecharts/SRF_GoogleBar.php
  • formats/googlecharts/SRF_GooglePie.php
  • formats/graphviz/SRF_Process.php
  • formats/incoming/SRF_Incoming.php
  • formats/jqplot/SRF_jqPlot.php
  • formats/jqplot/SRF_jqPlotChart.php
  • formats/jqplot/SRF_jqPlotSeries.php
  • formats/math/SRF_Math.php
  • formats/media/MediaPlayer.php
  • formats/slideshow/SRF_SlideShow.php
  • formats/slideshow/SRF_SlideShowApi.php
  • formats/sparkline/SRF_Sparkline.php
  • formats/spreadsheet/SpreadsheetPrinter.php
  • formats/tagcloud/TagCloud.php
  • formats/time/SRF_Time.php
  • formats/timeline/SRF_Timeline.php
  • formats/timeseries/SRF_Timeseries.php
  • formats/tree/TreeNodeVisitor.php
  • formats/tree/TreeResultPrinter.php
  • formats/valuerank/SRF_ValueRank.php
  • formats/widget/SRF_ListWidget.php
  • formats/widget/SRF_PageWidget.php
  • i18n/be-tarask.json
  • i18n/hsb.json
  • i18n/ko.json
  • i18n/lb.json
  • i18n/nl.json
  • phpunit.xml.dist
  • resources/jquery/fancybox/jquery.fancybox-1.3.4.pack.js
  • src/BibTex/BibTexFileExportPrinter.php
  • src/Graph/GraphFormatter.php
  • src/Graph/GraphPrinter.php
  • src/Outline/ListTreeBuilder.php
  • src/Outline/OutlineResultPrinter.php
  • src/Outline/TemplateBuilder.php
  • src/iCalendar/IcalTimezoneFormatter.php
  • src/iCalendar/iCalendarFileExportPrinter.php
  • src/vCard/vCardFileExportPrinter.php
  • tests/phpunit/Integration/I18nJsonFileIntegrityTest.php
  • tests/phpunit/Integration/JSONScript/JsonTestCaseScriptRunnerTest.php
  • tests/phpunit/Integration/JSONScript/TestCases/array-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/calendar-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/dataframe-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/datatables-02.json
  • tests/phpunit/Integration/JSONScript/TestCases/dygraphs-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/googlebar-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/googlepie-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/jqplotseries-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/listwidget-02.json
  • tests/phpunit/Integration/JSONScript/TestCases/prolog-01.json
  • tests/phpunit/Integration/JSONScript/TestCases/spreadsheet-01.json
  • tests/phpunit/Unit/Filtered/NumberFilterTest.php
  • tests/phpunit/Unit/Filtered/ResultItemTest.php
  • tests/phpunit/Unit/Formats/GalleryTest.php
  • tests/phpunit/Unit/Formats/SRFArrayTest.php
  • tests/phpunit/Unit/Formats/SRFListWidgetTest.php
  • tests/phpunit/Unit/Formats/TreeTest.php
  • tests/phpunit/Unit/Formats/ValueRankTest.php
  • tests/phpunit/Unit/Outline/ListTreeBuilderTest.php
  • tests/phpunit/Unit/Outline/OutlineResultPrinterTest.php
  • tests/phpunit/Unit/Outline/OutlineTreeTest.php
  • tests/phpunit/Unit/Outline/TemplateBuilderTest.php
  • tests/phpunit/Unit/ResourceFormatterTest.php
  • tests/qunit/formats/ext.srf.formats.gallery.overlay.test.js
  • tests/qunit/formats/ext.srf.formats.gallery.redirect.test.js

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upstream

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 and usage tips.

@ZoruaFox

ZoruaFox commented May 7, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request, delete build folder.

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.

7 participants