Page MenuHomePhabricator

Cargo does not rename hierarchy table names when a replacement table is switched in
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Define and create a Cargo table that uses a hierarchy field, e.g.
{{#cargo_declare:_table=Opinions
|Species=String (hierarchy;allowed values=*Human
*Orc
*Halfling
*Elf
*Dwarf
*Undead
**Skeleton
**Phantom
**Zombie
**Vampire
)
|Opinion=String
}}
  • Recreate data into a replacement table and switch in the replacement table

What happens?:
cargo_tables.field_helper_tables still refers to the hierarchy table names as they were during the replacement process, e.g. Opinions__NEXT__Species__hierarchy. If the table is then deleted, these hierarchy tables get left behind.

What should have happened instead?:
Hierarchy table names should be renamed inside cargo_tables too when the replacement table is switched in, like list tables already are.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change 1011196 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/extensions/Cargo@master] Fix hierarchy table names on table replacement

https://gerrit.wikimedia.org/r/1011196

Change 1011196 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] Fix hierarchy table names on table replacement

https://gerrit.wikimedia.org/r/1011196

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

@TK-999 - thank you for finding, and diagnosing, the problem! It was a pretty big bug. I assume this can be closed now.