Compare commits

...

2 commits

Author SHA1 Message Date
24c7c403ba Merge pull request 'Fix ambiguous 'online' column breaking every character page' (#3) from fix-ambiguous-online into master
Some checks are pending
Build / build (push) Waiting to run
Lint / eslint (push) Waiting to run
Reviewed-on: #3
2026-09-02 15:12:08 -06:00
Claude
0e7cf0f988
Fix ambiguous 'online' column on character pages
Some checks failed
Build / build (push) Waiting to run
Lint / eslint (push) Waiting to run
Build / build (pull_request) Has been cancelled
Lint / eslint (pull_request) Has been cancelled
The bot-account filter joins acore_auth.account, which has its own `online`
column. The character query selected several columns unqualified, so `online`
became ambiguous and every character page returned a 500:

  Error: Column 'online' in field list is ambiguous
    at CharacterController.getCharacterData

Qualifies every column in that SELECT with `characters`, rather than only the
one that collided, so a future join cannot reintroduce this. The search and
guild listings were never affected: DataTablesSsp always qualifies its columns
with the base table, and only this hand-written query did not.

Verified against the live realm - the previously failing query for
Heavenlymagi now returns its row, and a bot name still returns none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NW2ooBP2KPqQVzdZZDMvZd
2026-09-02 21:10:41 +00:00

View file

@ -354,7 +354,7 @@ export class CharacterController {
const [rows] = await this.armory.getCharactersDb(realm.name).query({ const [rows] = await this.armory.getCharactersDb(realm.name).query({
sql: ` sql: `
SELECT \`characters\`.\`guid\`, \`characters\`.\`name\`, \`race\`, \`class\`, \`gender\`, \`level\`, \`skin\`, \`face\`, \`hairStyle\`, \`hairColor\`, \`facialStyle\`, \`playerFlags\`, \`online\`, \`guild\`.\`name\` AS \`guild\` SELECT \`characters\`.\`guid\`, \`characters\`.\`name\`, \`characters\`.\`race\`, \`characters\`.\`class\`, \`characters\`.\`gender\`, \`characters\`.\`level\`, \`characters\`.\`skin\`, \`characters\`.\`face\`, \`characters\`.\`hairStyle\`, \`characters\`.\`hairColor\`, \`characters\`.\`facialStyle\`, \`characters\`.\`playerFlags\`, \`characters\`.\`online\`, \`guild\`.\`name\` AS \`guild\`
FROM \`characters\` FROM \`characters\`
LEFT JOIN \`guild_member\` ON \`guild_member\`.\`guid\` = \`characters\`.\`guid\` LEFT JOIN \`guild_member\` ON \`guild_member\`.\`guid\` = \`characters\`.\`guid\`
LEFT JOIN \`guild\` ON \`guild\`.\`guildid\` = \`guild_member\`.\`guildid\` LEFT JOIN \`guild\` ON \`guild\`.\`guildid\` = \`guild_member\`.\`guildid\`