Steps to replicate the issue:
- MediaWiki 1.39+
Extensions Involved:
- PageForms (5.9.1)
- SemanticMediaWiki (5.0.1)
Steps:
- Install and enable both PageForms and SemanticMediaWiki.
- Open Special:AdminLinks page.
- Notice that both extensions register their own Datenstruktur / Data structure section.
- When both hooks (PFHooks::addToAdminLinks and SMW\MediaWiki\Hooks\AdminLinks) run, multiple sections with the same header (e.g. Datenstruktur) are displayed.
- Each duplicated section contains overlapping links (like Kategorien, etc.), often appearing multiple times.
What happens?:
- Duplicate Admin Links sections (Datenstruktur / Data structure) appear when both PageForms and SemanticMediaWiki are installed.
- Some links (e.g. Kategorien) are shown twice within the same section.
- The section order may also become inconsistent due to multiple inserts.
What should have happened instead?:
- Sections with the same header should be merged into one unified section.
- Duplicate links (same label or target) should be displayed only once.
Screenshots:
How it looks like:
{F66779530}
How it should look like:
{F66779535}
Proposed fix:
- Update the ALTree::addSection() method to detect and merge sections that have the same header (case-insensitive).
When merging sections:
- Existing rows from both sections are combined, preserving their internal order.
- Duplicate links are removed to prevent repeated entries.
- The logic ensures that adding new sections via hooks (e.g. PFHooks and SMWHooks) no longer creates duplicates, but cleanly merges content into a single unified section.
- Final output in Special:AdminLinks now properly lists each section only once, maintaining alphabetical consistency.
Fix implemented in fork:
https://github.com/gesinn-it-ilm/mediawiki-extensions-AdminLinks/commit/8a9ba967890edf8e89b7a8a7d97625c57972de3a