Cargo: Common problems

From Gamepedia Help Wiki
Jump to: navigation, search

Common problems[edit | edit source]

  • If a table is recreated, it tends to not fill out all its rows. A workaround is to make null edits on the pages, which results in them getting stored in the Cargo table.
  • If a table is recreated via the web interface and the "job run rate" (set via $wgJobRunRate) is too high, it can lead to some pages not getting their data stored.
  • Sometimes rows get duplicated, for instance when making or editing redirects to pages stored in the table. A workaround is to make null edits on the pages, though this doesn't always work. Recreating data clears that but data recreation misses rows instead. group by helps clean up duplicates but there is no guarantee that you will get latest version.
  • Cargo tables can become quite large with a lot of fields. Since multiple tables can be joined together and queried for it is more elegant to move the fields to other tables instead. The caveat is that the templates need to be split as well otherwise Cargo bugs out. One template per cargo table.
  • Cargo doesn't handle incorrect Cargo queries gracefully and sometimes throws major errors that forces you to go back a page. Copy the source before submitting/previewing so your work doesn't get lost.
  • Frequently edits (or null edits) to pages will not result in tables being refreshed; this seems to vary with which user is performing the edit (some accounts are able to force updates to table, some aren't), and which table it is.
  • HOLDS can cause issues such as storing duplicate entries. Instead of using HOLDS try, *__full instead. The lists then becomes a ordinary string and can be queried as such.
  • Replace skill_gems.gem_tags HOLDS "Aura" with skill_gems.gem_tags__full LIKE "%Aura%"
  • Use regexp for more advanced queries: events.id__FULL REGEXP "(, |^)SSF Abyss(, |$)".
    • The delimiter in this case is ,
    • Replace | with {{!}} in normal wikitext.
  • #cargo_query returns integers/floats with thousand separator. Not surprisingly this will break most calculators. Wrap CONCAT() around the number field to remove thousand separators.
  • #cargo_query sometimes returns the numbers with hidden characters as well. Use no html to remove those.
  • If you are using |format=template, sometimes the page will load without any of the html parsing properly (or at all), as if you had also specified |no html. As a one-time workaround for this issue you can blank edit the page; however, the only way to completely eliminate it is to rewrite your query completely using Lua.