Skip to content

Fix/citoid dot separated placeholder#5643

Merged
GlazerMann merged 6 commits into
ms609:masterfrom
redalert2fan:fix/citoid-dot-separated-placeholder
Jul 3, 2026
Merged

Fix/citoid dot separated placeholder#5643
GlazerMann merged 6 commits into
ms609:masterfrom
redalert2fan:fix/citoid-dot-separated-placeholder

Conversation

@redalert2fan

Copy link
Copy Markdown
Contributor

Bug

The bot incorrectly adds |last1=Fullname} |first1=#Author| to citation templates when Citoid returns no real author name.

Example: {{cite web | title=Would eating heavy atoms lengthen our lives? | work=New Scientist | url=https://www.newscientist.com/article/mg20026841-800-would-eating-heavy-atoms-lengthen-our-lives/ }} gets changed to {{cite web | last1=Fullname} | first1=#Author | title=Would eating heavy atoms lengthen our lives? | work=New Scientist | url=https://www.newscientist.com/article/mg20026841-800-would-eating-heavy-atoms-lengthen-our-lives/ }}

Root Cause

PR #5636 added #author, #author fullname}, and fullname} to BAD_AUTHORS, but the Citoid API returns the placeholder as a single dot-separated field. The actual response from the Wikimedia Citoid REST API was:

{"creators":[{"creatorType":"author","firstName":"","lastName":"#author.fullName}"}]}

After mb_strtolower(), the value becomes #author.fullname}, which was not in BAD_AUTHORS. The existing entry #author fullname} (with a space) does not match.

Fix

Added '#author.fullname}' to the BAD_AUTHORS array in src/includes/constants/bad_data.php.

Migrate CI from ubuntu-22.04 to ubuntu-24.04 and switch actionlint
…arated placeholder

The Citoid API returns placeholder author data as a single field:
lastName='#author.fullName}' (dot-separated, camelCase), which was not
caught by existing BAD_AUTHORS entries (which had '#author fullname}'
with a space). After mb_strtolower the value becomes '#author.fullname}',
so add that variant to the list.

Fixes the bug where bot adds |last1=Fullname} |first1=#Author| to
citation templates for URLs where Citoid returns no real author.
@GlazerMann GlazerMann merged commit 6addca4 into ms609:master Jul 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants