Fix/citoid dot separated placeholder#5643
Merged
GlazerMann merged 6 commits intoJul 3, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.