Support wiki

This is the wiki.gg support wiki! It's a different site from your content wiki!

Cargo/troubleshooting

From Support Wiki
Jump to navigation Jump to search

Common problems with format=template

  • You must specify |named args=yes or you will receive your fields as |1=, |2=, etc, instead of with the correct field names.
  • If your field names have underscores in them, |format=template will pass these as spaces no matter what you specified in your field names. For this reason (among others) it is recommended that you use camelCase for field names.
  • If you want to use wikitable syntax, you'll need a blank line on the first line of your subtemplate.
  • But also it's easy to have accidental extra whitespace in your subtemplate and run into problems.
  • It may be a bit tricky to do the start & end of your wikitable syntax inside of the cargo_query as the |intro= and |outro= parameters since you have to escape all the pipes. Use {{(!}} etc or place this code outside of the template (as long as you are certain you have results).

Common problems in queries

  • If you are using CONCAT() or GROUP_CONCAT, you MUST alias your field, e.g. CONCAT("[[",Name,"]]")=Name and NOT CONCAT("[[",Name,"]]").
  • The condition |where=_pageName = '{{PAGENAME}}' may sometimes not work due to special characters in the page name conflicting. You should instead write |where=_pageID = '{{PAGEID}}', which should always function exactly identically.
  • If you want a case-sensitive query, use the BINARY keyword, e.g. BINARY Items.InternalID = "GFsdf45567FFsdfer34pineapple".

With Lua

  • In Lua, when using HOLDS, errors given are often completely incorrect from the actual issue. Ideally, just don't use HOLDS period. If you need to, ignore the error text if you get any and debug it on your own.

With the MediaWiki API

  • When querying Cargo via the MediaWiki API, you need to create an alias like _pageName=Page any time a field name is prefixed by an underscore.

Miscellaneous common problems

  • Similar to the issue with thousands separators and numbers, you also may need to wrap fields that are stored via the {{PAGENAME}} magic word in a TRIM(). (_pageName is a default field but maybe you used {{#titleparts:}} for a field.)
  • Each template can only attach 1 table. So if you need a template to write to multiple tables, you might have to create "fake" templates that do nothing other than attach the table, but then are transcluded by the template doing the storing onto every page along with the store.
    • Similarly, a template can only declare one table.
    • A template CAN, however, both declare and attach - for a maximum of 2 tables available without any workarounds.
    • See Attaching tables for more information.
  • unique is broken, don't use it
  • VisualEditor may sometimes eat the whitespace of any Cargo query that's placed on a content page, so wikis with VE (and also all wikis) should place queries in template pages so this doesn't happen.
    • This should not change your output ever, but it may be frustrating to editors who aren't using VE.

Help! My table isn't repopulating!

See also: Cargo/recreating tables, particularly Help, my replacement table is missing rows!

If you recreate your table and it refuses to repopulate, here's a couple things you can check out:

  1. Correct attach or declare: Are you for sure attaching or declaring your table?
    • ...to the correct template?
  2. Wrong data types:
    • Are all your integer fields actually integers (no wiki markup, no letters, no + sign, no decimal points)?
    • Are all your float fields actually numbers (no wiki markup, no letters, no + sign)?
    • Is there a zero-width space? A good way to check is to copy-paste into a text editor like Notepad++ that will highlight such things for you.
    • Are any of your strings too long? By default, a string can be at most 300 characters. You can change this by writing |FieldName=String (size=500), or whatever your desired size is. However, you might prefer to change a long string field to Text.
  3. Does your table have too many columns? The precise number of columns you can have depends on some wiki settings, but if you're at about 60 or so columns, you might worry about this.
  4. Are you waiting long enough? If you've checked EVERYTHING above and are 100% sure it's not one of these issues, try waiting up to ~20–30 minutes for it to start populating.

Known bugs

  • There is currently no way to query on fields that hold a list of coordinates.
  • 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.
  • If the magic words {{PAGENAME}} or {{PAGENAMEE}} are contained in some field, any non-ASCII characters in the page name will be stored in encoded form - either HTML-encoding or percent-encoding, respectively - and then displayed that way also. A possible workaround for this is wrapping magic words in a template or Lua module that decodes special characters.
  • In the _pageData table, categories are not stored immediately when added; the page must be blank edited. Fixing this requires a large rewrite of how Cargo data is stored.
  • Cargo has almost no error state logging, so it's hard to tell when something is failing.

Limitations of native Lua support

The following parser functions have no Lua equivalent on wiki.gg (some have been disabled due to lack of active maintenance in the upstream extension), but you can still use frame:callParserFunction():

  • cargo_store (disabled on wiki.gg due to poor support)
  • cargo_declare (disabled on wiki.gg due to poor support)
  • cargo_compound_query (also not present in upstream Cargo)
  • cargo_attach (also not present in upstream Cargo)

Planned features

Features that it would be useful to add to Cargo include:

  • More display formats, including more complex charts
  • The ability to call stored procedures, perhaps using a new "#cargo_call" function, to enable more complex, and possibly faster, querying

Cargo features unavailable on wiki.gg

For a variety of reasons (performance, stability, bloat) some features documented on mediawiki.org are unavailable on wiki.gg. This includes:

  • The ability to "implicitly store" Cargo values based on template parameters or to omit the table name in a #cargo_store call
  • All drilldown functionality
  • Some data formats relying on large JavaScript libraries
  • The "rating" format (this may be available but it's planned to be disabled)
  • Native store and declare Lua functions