Project:ModSecurity false positive affecting Page Forms

From Azeroth Gazetteer
Revision as of 11:54 AM, November 5, 2026 by Beornulf (talk | contribs) (Documenting a possible bug in Page Forms)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ModSecurity false positive affecting Page Forms documents a reproducible problem on Azeroth Gazetteer involving the Page Forms extension and references entered into template fields. When a field contains a literal <ref>...</ref> citation, previewing or saving through Page Forms can produce an HTTP 500 (Internal Server Error). The equivalent content works through the ordinary source editor, and two alternatives have rendered successfully in Page Forms previews: the self-contained {{#tag:ref|...}} syntax and self-closing named references (<ref name="source" />) whose definitions are present elsewhere on the page. Only the former has been verified through saving and reopening.

This is a record of observed behaviour and locally tested workarounds, not a confirmed identification of the faulty extension or function.

  • First documented here: 5 November 2026
  • Status: Unresolved; #tag:ref verified through save and reopen; named self-closing references verified in preview
  • Affected workflow: Editing template parameters through Page Forms
  • Preferred workaround: {{#tag:ref|citation}} (self-contained)
  • Additional preview-tested alternative: <ref name="source" /> (requires a separate, matching definition)

Software environment

The following software versions were reported from Azeroth Gazetteer on 5 November 2026, when the issue was reproduced:

Component Installed version
MediaWiki 1.45.3
PHP 8.4.27
Page Forms 6.0.11
Cargo 3.9.4
Cite Version not declared in Special:Version

Cite is installed and functional, but the installation's Special:Version interface does not supply a numerical Cite version. No Cite version is inferred. These details describe the local environment and do not by themselves establish which component causes the failure.

Symptoms

The problem has appeared in more than one form or template. A reference entered into certain Page Forms fields causes an HTTP 500 error when either Preview or Save is selected. Removing the literal <ref>...</ref> element allows the form to proceed normally.

The failure is not a general inability to use templates in a form field: ordinary transclusions, including {{df}}, have worked. Nor does the Cite extension fail everywhere on the wiki: references in the article body work through normal source editing.

The clearest reproduction occurred while editing Blackened Woods using Form:Location, in the Former name(s) field. An earlier incident affected a citation for Falstad Wildhammer in the current-ruler information of Wildhammer Clan.

Reproduction on Blackened Woods

In Form:Location, the relevant input is defined as:

{{{field|fname|input type=textarea|rows=2}}}

Its value is passed to Template:Locationbox, which displays the parameter and also passes it to Cargo as Former_name, declared as Wikitext string.

To reproduce the failure:

  1. Open Blackened Woods using Edit with form.
  2. Enter a citation in Former name(s), for example:
Eversong Forest<ref>Test citation</ref>
  1. Select Preview or Save.

Observed result (5 November 2026): The request returns HTTP 500. Removing the <ref>...</ref> element avoids the failure.

The same citation works when placed directly into the fname template parameter through the ordinary source editor. Ordinary editing worked both with normal Cargo storage and with the template's existing nocargo=yes switch. This narrows the failure to the form-editing workflow, though it does not independently establish whether the fault lies in Page Forms, an interaction between extensions, or the server's handling of that path.

No corresponding application error was identified in the available DreamHost panel logs. Unrelated Apache AH01630 access-denied messages for forbidden.html did not coincide with the failed edits. The precise PHP exception or fatal error remains unknown.

Verified workaround

Use MediaWiki's #tag syntax to construct the reference instead of typing a literal opening and closing ref tag into the Page Forms field.

Instead of:

Eversong Forest<ref>Citation text</ref>

Use:

Eversong Forest{{#tag:ref|Citation text}}

The workaround also accepts tested citations containing other templates. For example:

Eversong Forest{{#tag:ref|{{df}}, pp. 152–153}}

Verified on Blackened Woods: The alternative syntax rendered citations correctly in preview, allowed the page to be saved, remained present when the page was reopened through Edit with form, and allowed subsequent previews without an error. It was subsequently used to restore the missing Falstad Wildhammer citation in Wildhammer Clan.

This is standard MediaWiki parser-function syntax, not a Gazetteer-specific extension or a change to the Cite extension. MediaWiki's documentation notes that #tag processes enclosed template calls differently from literal XML-style tags.[1]

For now, prefer the self-contained #tag:ref form in affected Page Forms fields. Ordinary <ref>...</ref> citations can continue to be used in article prose when editing normally. The workaround is verified for the tested cases, not guaranteed for every field or extension combination.

Named references and self-closing tags

MediaWiki permits a citation to be defined in one place and reused elsewhere with a self-closing tag such as <ref name="source" />.[2] Historical Page Forms release notes also mention a fix concerning self-closing tags.

Verified in preview on Blackened Woods (5 November 2026): With the full named references defined elsewhere on the page, the following text was entered into the Former name(s) field of Form:Location:

Eversong Forest<ref name="one" /><ref name="two" />

Selecting Preview succeeded without an HTTP 500 error. The preview displayed two linked reference numbers after Eversong Forest in the infobox and displayed the corresponding citations under Endnotes. In this test, the citations referred to Tides of Darkness (2007), chapter 14, and Dark Factions (2008), pages 152–153. The screenshot also showed references to the same notes in the article body, producing multiple backlinks in the endnotes.

For example, the full citation definitions could be supplied in relevant article prose:

The earlier name is attested in the sources.<ref name="one">''[[Tides of Darkness]]'' (2007), ch. 14</ref><ref name="two">{{df}}, pp. 152–153</ref>

Limits of this test: Successful Preview is confirmed. Saving and reopening the form with these self-closing tags has not yet been independently verified. This alternative requires the matching full definitions to remain on the same page; removing or renaming a definition can leave an undefined named reference. Accordingly, {{#tag:ref|...}} remains the preferred workaround when a citation should be self-contained and local to the infobox field.

A distinct Cargo issue: UNIQ markers

During the investigation, a separate problem was confirmed in the Locations Cargo table: the stored Source values for Kalidar and Nighthaven included internal reference placeholders such as UNIQ--ref-00000008-QINU, although the pages' raw wikitext contained valid <ref>...</ref> citations.

The Source field is declared as Wikitext, whereas Former_name is declared as Wikitext string. These facts may matter to the parsing and storage behaviour, but the observations do not prove that field type is the cause of either problem.

Do not conflate the two symptoms.

  • HTTP 500 on form preview/save: A request fails while processing a Page Forms edit containing a literal reference tag.
  • UNIQ markers in Cargo results: A page may render normally while Cargo stores or returns an internal parser placeholder instead of usable reference markup.

A January 2026 MediaWiki discussion specifically attributed a similar UNIQ-marker problem to Cargo's storage of partially parsed ref and pre content, correcting an earlier suspicion about Page Forms.[3]

No change to Cargo field declarations, infobox templates, or Page Forms settings was necessary to use the verified citation workaround.

The following material describes related difficulties, not confirmed duplicates of the current HTTP 500 failure:

  • December 2014: A Semantic Forms (the former name of Page Forms) user reported that a literal reference in a textarea became a UNIQ...ref...QINU marker after saving. Direct editing worked. Yaron Koren discussed the report, but no publicly documented resolution appears in that discussion.[4]
  • April–May 2020: Page Forms 4.9 improved handling of tags such as nowiki and syntaxhighlight in template fields. Version 4.9.1 specifically fixed handling of self-closing tags such as <ref />. These release notes do not establish a fix for paired reference tags in the present environment.[5]
  • July 2021: A MediaWiki support discussion recommended #tag:ref to avoid a reference-expansion problem in templates; the original reporter confirmed that it worked.[6]
  • September 2025–March 2026: Wikimedia task T406042 reported a different Page Forms HTTP 500 failure involving templates inside pre tags and PHP memory exhaustion. A patch was merged in March 2026 and the task was subsequently marked resolved. It should not be assumed to fix this citation problem.[7]

Outstanding questions

  • Does the Cite extension have a distinct release or commit identifier relevant to the installation? Special:Version does not declare a Cite version; the other software versions have been recorded above.
  • What PHP exception or fatal error causes the HTTP 500? The hosting panel's available logs did not establish this.
  • Is the failure reproducible in a minimal Page Forms installation without Cargo, or is an extension interaction required?
  • Do particular input types, fields, or patterns of nested markup trigger the failure consistently?
  • Does the successful preview with self-closing named-reference tags also survive Save and reopening the form?
  • Does Cargo store reference text correctly when the corresponding page was saved through Page Forms using #tag:ref? Successful rendering alone does not establish correct Cargo storage.

Until the underlying error is identified, prefer the proven #tag:ref save-and-reopen workaround; use preview-tested named self-closing references cautiously, and avoid unnecessary modifications to the live Cargo schema or templates.

Endnotes

  1. ↑ MediaWiki: Help:Magic words, section on #tag; see also Help:XML-style tags
  2. ↑ MediaWiki: Help:Cite, section on multiple uses of the same footnote
  3. ↑ MediaWiki: Extension talk:Page Forms, Jonathan3, 13 January 2026
  4. ↑ MediaWiki: Extension talk:Page Forms, September–December 2014 archive, section “<ref></ref> transformed to UNIQ…” (26–30 December 2014)
  5. ↑ MediaWiki: Extension:Page Forms/Version history, entries for versions 4.9 and 4.9.1
  6. ↑ MediaWiki support desk: “Extension Cite: references-tag does not work in Templates for me”, 6–7 July 2021
  7. ↑ Wikimedia Phabricator T406042, including its March 2026 event history