Extension:Cargo/Common problems

From MediaWiki.org
Jump to: navigation, search
Cargo - navigation
Basics Main pageExtension:Cargo (talk) · Download and installationExtension:Cargo/Download and installation · Quick start guideExtension:Cargo/Quick start guide · Other documentationExtension:Cargo/Other documentation · SMW migration guideExtension:Cargo/SMW migration guide
Using Cargo Storing dataExtension:Cargo/Storing data · Querying dataExtension:Cargo/Querying data (Display formatsExtension:Cargo/Display formats) · Browsing dataExtension:Cargo/Browsing data · Exporting dataExtension:Cargo/Exporting data · Other featuresExtension:Cargo/Other features
Resources for help Common problemsExtension:Cargo/Common problems · Known bugs and planned featuresExtension:Cargo/Known bugs and planned features · Getting supportExtension:Cargo/Getting support
About Cargo Authors and creditsExtension:Cargo/Authors and credits · Version historyExtension:Cargo/Version history · Sites that use CargoExtension:Cargo/Sites that use Cargo · Cargo and Semantic MediaWikiExtension:Cargo/Cargo and Semantic MediaWiki · FAQExtension:Cargo/FAQ
  • If you see an error message that looks like "A database query error has occurred. This may indicate a bug in the software.", you should add the following to LocalSettings.php, so that the page displays a more helpful error message:
$wgShowSQLErrors = true;
  • Similarly, if you see an error message like "Fatal exception of type MWException", add the following to LocalSettings.php for a more helpful error message:
$wgShowExceptionDetails = true;
  • If the "where" clause contains something like "_pageName = '{{PAGENAME}}'", the query will break for pages that contain a single quote/apostrophe (') in their name. There are a few potential fixes for this: the easiest is to change the query to "_pageID = {{PAGEID}}", which should always work. Another option is to change it to "_pageName='{{#replace:{{PAGENAME}}|'|\'}}'". (You could also consider replacing the single quotes around {{PAGENAME}} with double quotes, but single quotes are generally preferred for SQL literals, plus this formulation will itself break if the page name contains double quotes.)
  • By default, '=' comparisons in MySQL are case-insensitive. If you want an '=' comparison within the "where" clause to be case-sensitive, you can do it by adding "BINARY" to the comparison, like "BINARY Nickname = 'Joe'". You can do the same thing for "HOLDS" statements, like "BINARY Genre HOLDS 'Drama'".
  • Unlike Semantic MediaWiki, Cargo does not provide a "class" parameter for any of its formats. However, you can still define custom formatting for a display, by wrapping a #cargo_query call inside a "div" or "span" tag that has its own class declaration, like <div class="black">{{#cargo_query|...</div>. Then the CSS you use can contain calls like "div.black table ...", or whatever it is.
  • If you have the Joomla! CMS running on the same server as MediaWiki, it may lead to the Cargo "recreate data" action failing. That is because one of Joomla's recommended htaccess settings blocks the string "template" in the URL, and Cargo uses this word as a parameter in its API call. To get Cargo working, you will probably have to modify or remove this line.
  • If you want to show a row number for each row in the query results, the easiest approach is to use the "template" format, and use the NumerAlpha extension - specifically the #counter parser function - within the template.