Extension talk:Cargo

Data in cargo table not updating after I renamed a column title
I changed the name of a column header and changed the data type from boolean to text, now when I try to add text to the new field it will not save. The new header name also disappeared from the drilldown menu... I renamed all the references to the old header in the template, am I missing somewhere else where I have to rename the old column header?


 * Did you recreate the table? And does the listing for that table look correct in its Special:CargoTables page? Yaron Koren (talk) 21:21, 13 May 2020 (UTC)

Cargo equivalent to SMW's #show?
I'm sorry if this is a stupid question or if I missed something obvious. I've been trying to make it where infoboxes on my wiki will display data from another specified page so that information that changes there will be changed on other pages automatically, something I know how to do using Semantic MediaWiki's #show function. However, I can't seem to find any information on how to do anything like that with Cargo, and I don't know if it's because it doesn't exist or because I don't know how to look for it. Does an equivalent function exist in Cargo? Where can I learn how to use it? (P.S. In case you're wondering why I would want to do this over just updating the relevant pages, it's for ranked taxonomy in an ongoing evolution game. Basically, that means information potentially relevant to hundreds of pages is expected to change semi-regularly.) Disgustedorite (talk) 00:55, 14 May 2020 (UTC)


 * There's no equivalent for #show, although #show itself is not really necessary - it's just slightly different syntax for #ask. Similarly, you can just call #cargo_query to get a specific field value for a specific page. If that seems like too complex a call to make every time, you could always create a "show" template that wraps around #cargo_query and takes in the necessary values: table name, field name and page name, or some subset of those. Yaron Koren (talk) 12:10, 14 May 2020 (UTC)


 * Apologies for the very, very late response. I have no idea how to actually do it, though. I do not know how to use #cargo_query to display a single value from a single page because I cannot find any information on how to do so, or I am not understanding the information about how to do so, possibly due to the severe lack of examples provided. I asked if I'm missing something and where I can learn. Disgustedorite (talk) 08:15, 13 July 2020 (UTC)


 * EDIT: Nevermind, I am embarrassed to admit that I immediately figured it out. The pages on Cargo's functions really need examples and previews. Disgustedorite (talk) 08:27, 13 July 2020 (UTC)

Cargo equivalent to SQL arithmetic operations between 2 or more columns?
Greetings.

Considering the following SQL query: SELECT column1 + column2 AS "add", column3 * column4 AS "multiply" FROM table1;

Is it possible to achieve such behavior in Cargo?

-- N tonio36 (talk) 03:34, 15 May 2020 (UTC)


 * I don't think so, unfortunately. If there are specific sums, products, etc. you want to display, the only way to do it may be to have the template store those as separate fields - calculating them using #expr from the ParserFunctions extension. Then it's just a matter of querying those fields. Yaron Koren (talk) 04:16, 15 May 2020 (UTC)

Title disambig text
For Cargo. I'm using this template with the following code. But when you go to special:CargoTables/Articles, the "history" column appears empty. How can I fix that? The reason is that in my personal wiki I develop fictional content and to differentiate one from another that have the same name, I add a title in brackets. --Hispano76 (talk) 19:26, 16 May 2020 (UTC)


 * Does  display what you expect (i.e. the part of the page title which is within round brackets) when it's just on its own on the page? Does plain text save to the Cargo table? Is history correctly declared in the template? Jonathan3 (talk) 20:50, 16 May 2020 (UTC)
 * when it's just on its own on the page? yes
 * Does plain text save to the Cargo table? no, is blank
 * Is history correctly declared in the template? yes
 * Greetings. --Hispano76 (talk) 21:41, 16 May 2020 (UTC)


 * Could you cut and paste here your template for the Articles table? Jonathan3 (talk) 21:47, 16 May 2020 (UTC)


 * For example (in spanish). Grettings. --Hispano76 (talk) 22:01, 16 May 2020 (UTC)

Multiple Cargo wikis from one database
Is it possible to set up one stand-alone database to store the cargo tables from multiple wikis? I was thinking of using separate prefixes per database, and it looks like it currently uses $wgDBprefix, but I have that overlapping in some wikis. Would it be possible to get $wgCargoDBprefix, or is there another option? -- Prod (talk) 22:09, 18 May 2020 (UTC)


 * Sure, it sounds possible to have multiple wikis use the same database as their Cargo database - and if each one had a different DB prefix, then you would prevent collisions. You couldn't have wikis then access each others' data, but you could query all the tables together outside of MediaWiki. Yaron Koren (talk) 13:51, 19 May 2020 (UTC)

How to query out a Cargo "Datetime" column in local time
Hi everyone, hope you're well.

I'd like to use  to pull out page creation/modification times from the fields in the   table (which I've switched on with  ) in the user's local timezone.

What I've managed to do is whitelist using the   array, and then use something like   in the Cargo query. This isn't a great solution because now I've hard-coded a time zone in the query, and my users might have a different local time zone in their preferences. What I was hoping for was a way to just default to showing  fields in the user's local time.

I see that another option might be to use, then, in the template, wrap the returned   field with the   parser function, and that may be the route I end up going in the end. I just miss the convenience of the "table" output format, because it saves a lot of work (thanks Yaron!).

What I'm wondering is whether there isn't a more Cargo-y way to do this, like something built in that I just missed.


 * It looks like what's missing is a variable like " ", which would return a value like 'America/New_York' for each user. If such a thing existed, you could pass that in to CONVERT_TZ within #cargo_query, and I think you'd get exactly the output that you're looking for. I don't believe any such variable exists. I don't know what the best approach is to create it - maybe to use the MyVariables extension, and add this additional variable to it. It'll require some PHP programming... which hopefully you can do. Yaron Koren (talk) 00:38, 25 May 2020 (UTC)


 * OK, I was initially confused whether magic words or parser functions would be parsed in the  parameter of , but now it seems obvious that they would be. I'm already using Extension:WikiUserInfo with the "dangerous functions" enabled on a non-public wiki, which provides a parser function version of what you describe, so maybe that's my solution.


 * As far as Cargo is concerned, do you think there's any merit in defining a  /   field type, the results of which always come back formatted using the user's timezone preference, or maybe a   field parameter? Or a   to default to displaying   /   fields using the server's  ? I'm not pestering you with a feature request, just wondering if you think that would be a worthwhile addition, or out of the scope of what you believe Cargo's job should be with respect to DATETIME fields. --Ernstkm (talk) 05:00, 27 May 2020 (UTC)


 * That's an interesting question, of when (if ever) it makes sense for times to be displayed in the user's time zone, rather than the wiki's, if there's a difference between the two. You mentioned a few options: per field, with some new types; per wiki, with a global variable; and of course, per query field, with that CONVERT_TZ approach you discovered (I'm glad that works, by the way, even if it's "dangerous"). I can think of two more: per user, with a new preference like "Display Cargo times in my timezone"; and per query, with a new parameter to #cargo_query.


 * I guess the question is, what's the logic to determine whether any specific time should be shown in the user's time zone or not? Does it depend mostly on whether this is an event that someone in a different time zone could participate in? And is there the possibility that having too "clever" a solution could lead to user confusion about which times are in their time zone and which are not? Yaron Koren (talk) 13:46, 27 May 2020 (UTC)

Write to Cargo tables in Lua
Cargo is amazing. Thank you! Just one issue -- Is it possible to write to Cargo tables in Lua? My module is used in the same template that defines the table. It iterates over an unlimited number of infobox-like numbered params (entry1=foo, entry2=bar, etc.) so it would be tedious to do the storage via wikitext. I think I could get away with the Lua module returning the  code along with the generated wikitext... but that seems hacky. &mdash; MusikAnimal  talk  05:39, 24 May 2020 (UTC)


 * I'm glad you're enjoying Cargo! I don't know that much about Lua programming, but I believe that, instead of passing in that wikitext (which would indeed be hacky), you should use the callParserFunction method to call #cargo_store. Eventually, I hope there will be native Lua methods for #cargo_store and #cargo_declare, like there is for #cargo_query. Yaron Koren (talk) 00:40, 25 May 2020 (UTC)
 * I do not know Lua very well either, but that's exactly what I was looking for! It's essentially the same as a native call, from a programmer standpoint. What I wanted to avoid was all that string concatentation in building the wikitext. This allows me to pass in key/value pairs, so consider it solved. I have made note of this in docs with Special:Diff/3875998. Thanks! &mdash; MusikAnimal  talk  04:47, 25 May 2020 (UTC)

database error after renaming (moving) a template
I've created a template, called TEMPLATE_foo_bar, which has the following lines in it:

to store data and



to declare the respective table. This used to work well. Now I moved the template to something called TEMPLATE_foo_xyz and also replaced any occurrence of "bar" with "xyz". Nothing else was changed. After that I recreated the cargo table which also worked fine. But now if I try to use this template, it keeps throwing error messages at me, namely

Now the funny part is that the column in all lower case does not exist indeed. But it exists exactly as I spelled it in the template. If I enclose PROPERTY_foo_xyz with quotationmarks in the template, it works again. I checked the table and column names in the backend. They look exactly as they should. Again, the only thing I did was to move the template and replace 3 characters in the code with another 3 characters. What do you make of this? How to get this to work again? Thanks in advance.

--Mwarge (talk) 15:26, 26 May 2020 (UTC)


 * That's strange. What version of Cargo are you running? Yaron Koren (talk) 17:48, 26 May 2020 (UTC)


 * As of today it is the latest 2.5-release. Downloaded and installed after the error occured. I am not 100% sure which version I used before, but I guess I can figure that out if needed. Also I ran update.php before and after setting up 2.5. --Mwarge (talk) 19:43, 26 May 2020 (UTC)


 * What about the display of the table in Special:CargoTables, and in the Special:CargoTables subpage for that table - does it show up correctly in both? Yaron Koren (talk) 20:09, 26 May 2020 (UTC)


 * I am quite sure it did. In the meantime I renamed the template (and table/column) to yet something else and it did not work. Then I restored to the version I originally wanted to work, recreated the tables once again and voila - now it works. Special:CargoTables shows everything correctly. Also the subpage for that table looked correct as it always did after (re)creating the tables, eventhough there is a notice about some jobque (got a localized message and im not sure what the english version is). This notice was there before today and I am not quite sure what kind of job this might be. php runJobs.php does nothing. Anyhow, for the moment my problem got magically resolved. I'll keep an eye on that and report back if something happens. I moved/renamed quite some templates and tables along with their columns, so the issue might show up again somewhere else. Let me know if you'd like more info on something and thanks so far.


 * I have no idea why any of that happened, but I'm glad it's working now! Yaron Koren (talk) 21:48, 26 May 2020 (UTC)

Subquery expands right in other formats but not calendar
I have the following query with subqueries. When I run it in default format without specifying anything, the subquery expands as I would expect. When I add format=calendar the calendar days just contain the not-yet-executed query code. Here is the query:

Here is what shows in a calendar day box when I run it with |format=calendar, so here is a typed version but it will likely have Days: &amp;lt;br&amp;gt;Nights:

As I re-read this I realize there might be an easier way to write the query for calendar view (I am re-using this from a table view where I had to us a table with all dates to force blank boxes), but it still seems like a bug that the code that expands fine in other formats doesn't in calendar format. Thanks! Tenbergen (talk) 20:02, 27 May 2020 (UTC)


 * Wow, that's... impressive. :) I've never heard of constructing a #cargo_query call as the result of another #cargo_query call, although I can see how it would work. Yes, the "calendar" format doesn't parse the contents of its results, and it probably should. Still, I hope there's a less hacky solution than this... Yaron Koren (talk) 14:08, 28 May 2020 (UTC)
 * You mean others are not doing this? The ability to stick all sorts of things into a CONCAT statement is one of the features that have pulled me from SMW to Cargo, it adds a lot of flexibility in aggregating information. I love that I can do that on one line in Cargo, where if I can do it at all in SMW I would have to do it through a template. Tenbergen (talk) 21:42, 28 May 2020 (UTC)


 * Right, I've never heard of anyone else doing this. Now I'm curious: could you describe what it is that you're trying to display? I want to know if there's a real use case for this kind of approach. Yaron Koren (talk) 00:12, 29 May 2020 (UTC)


 * I have pages for shifts that contain multiple entries that encode the date and the name of the person who is to work the shift. In this case, one shift is a night shift and one a day shift. The people who use the data would like a calendar that lists both the day and night person. Of course it should still list the day even if the night is not covered. It seems like I should be able to pull this into one query and concatenate this, e.g. by calling the table twice and filtering one for day shifts and one for night shifts, but that is not working as expected, so also see my question below re joins. To work around that, I did it with the query inside a query.
 * Are you wondering whether there is a use case for query-in-query in calendars or in general? Tenbergen (talk) 20:46, 1 June 2020 (UTC)
 * In general. Do you know about the GROUP_CONCAT function? It works in conjunction with "group by". It could potentially be a simpler approach to displaying what you're trying to display... Yaron Koren (talk) 20:51, 1 June 2020 (UTC)
 * I did not know about that function, thanks for the tip! It allows further functions inside it, so something like  gives me the text I need. However, when I turn format=calendar, the &lt;br&gt; doesn't turn into the expected newline, but instead displays as "&ltbr&gt". Tenbergen (talk) 21:23, 1 June 2020 (UTC)
 * That's looking better already. :) Instead of the &lt;br&gt; tag, how about just putting two actual newlines there? I don't know if that will have any effect, but it's worth trying. Yaron Koren (talk) 21:59, 1 June 2020 (UTC)
 * You got it: the \n in the following adds the newline: GROUP_CONCAT(if(_pageName = "Gastroenterology Days Staff", "Day: ", "\nNight: "), sName). Thanks Yaron! Tenbergen (talk) 02:10, 2 June 2020 (UTC)
 * Great! I meant an actual newline, but if "\n" works, that's even better. It probably still makes sense to get the calendar format's parsing to match those of the other formats, but I'm relieved to hear that it's not necessary for this. And even more relieved that that original monstrosity can be avoided... Yaron Koren (talk) 02:28, 2 June 2020 (UTC)

Are those joins really left outers?
I ended up doing because I am not sure that the join on actually works as a left outer join as described in here. I have two pages "day shift" and "night shift" that each hold multiple template calls that populate the sDays and sNames for those shifts. Some dates in that list only have either a "day" or "night" entry. If both are not present, the line doesn't show up. For example, I tried to re-write the query above to not use the query-in-query. When I write it as the following I don't get an line for a date where only the "day" has a record:

When I instead only pull in the Day part of the table I get the line. EG Still testing

If it was a left outer join I would have expected the line to show in the first query, just with the night column empty. I was able to overcome this problem with the Subquery expands right in other formats but not calendar|above]] for non-calendar layout, but it doesn't work in calendar layout. So how would I need to do the query to also get lines that only have an entry for one column (resp one joined table)? Tenbergen (talk) 22:14, 28 May 2020 (UTC)

Error in HOLDS when search value has apostrophe
Hello! After Cargo was updated to version 2.5, the Wiki I'm working on is getting the following error for HOLDS queries that previously worked.

Version: 2.5

Tested Queries

Errors

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: SELECT `_pageName` AS `_pageName` FROM `cargo__Stages` WHERE `cargo__Stages`.`_ID` IN (SELECT _rowID FROM `cargo__Stages__Drops` WHERE _value = "Lucien') s Microphone" ORDER BY `_pageName` LIMIT 100 Function: CargoSQLQuery::run Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near at line 1 (dbt1.miraheze.org)

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: SELECT `_pageName` AS `_pageName` FROM `cargo__Stages` WHERE `cargo__Stages`.`_ID` IN (SELECT _rowID FROM `cargo__Stages__Drops` WHERE _value = 'Lucien\') s Microphone' ORDER BY `_pageName` LIMIT 100 Function: CargoSQLQuery::run Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near at line 1 (dbt1.miraheze.org)

Looking at the repo, seems like it's related to the changes in  and , which looks like it's picking up the apostrophe in the pattern match.

For anyone else encountering the issue, this can currently be worked around by directly using the helper tables:

Workaround

--Elaeagnifolia (talk) 16:02, 29 May 2020 (UTC)
 * Another user on the same Wiki host also reported issues with HOLDS as well. Just using  works, but anything after will error out the query (eg.  ). I've shortened the error message, but you can see that there's a closing parentheses being appended to.
 * ...(SELECT _rowID FROM cargo__CompetitorInfo__PreviousAliases WHERE _value = cargo__TournamentCompetitorScores.Player AND cargo__CompetitorInfo.Player = ') Todd' GROUP BY cargo__TournamentCompetitorScores.Tournament ORDER BY cargo__TournamentInfo.StartDate LIMIT 100 Function: CargoSQLQuery::run Error: 1064...
 * --Elaeagnifolia (talk) 01:42, 30 May 2020 (UTC)


 * Sorry about that, and thanks for letting me know. There was just a change checked in to Cargo that I believe fixes both issues. Yaron Koren (talk) 15:07, 2 June 2020 (UTC)

DISPLAYTITLE
Any chance on setting a the DISPLAYTITLE to the string from a cargo field? a la Whenever i do this the title defaults back to its PAGENAME, whereas the query works elsewhere on the page, and setting the title to something else also works.

I've searched this talk page but didn't find a definite answer if this is possible or not. For the Extension:DisplayTitle there is an existing thread Topic:Thao0y9d7e9y52bk from which i take it it's possible. But from that I'm left confused whether to use the deprecated Semantic Title, the built in magicword, or the extension and I cannot get it to work with either of these. Keep up the great work! --Fehlerx (talk) 23:39, 2 June 2020 (UTC)


 * Try adding "|no html" to the #cargo_query call - that might help. Yaron Koren (talk) 23:40, 2 June 2020 (UTC)


 * Thank you!!--Fehlerx (talk) 01:05, 3 June 2020 (UTC)

Still getting internal error on recent changes
This is a follow-up to Internal error on Recent Changes after running cargoRecreateData.php and possibly also related to "Use of Parser title should never be null was deprecated in MediaWiki 1.34.".

Yaron had suggested changing line 1160 of /includes/CargoUtils.php from  to , which seemed to fix the problem until the overnight scheduled run of our maintenance script breaks it again. I just updated to the newest version of MW and Cargo hoping that might fix it, but it's still a problem. Tenbergen (talk) 01:28, 12 June 2020 (UTC) This was also reported on https://phabricator.wikimedia.org/T241302


 * I have given up on a fix for this and instead set up a cron job that deletes the offending lines with a "Delete FROM recentchanges where not (rc_title > ""). This fixes recent changes for me on that wiki. Tenbergen (talk) 16:12, 24 June 2020 (UTC)

Ignore a namespace or a magic word to ignore the #cargo_store in a page ?
Hello Yaron Koren,

First, thank you so much for your great extension.

I run an online dictionary for kids and use a template to show the data nicely.

That template is storing the data in the Cargo database.

I want to use the same template to show the "word of the week" nicely. Problem : the word gets stored twice in the database. Part of the solution, maybe : the word of the week isn't in the same namespace as the actual words.

I couldn't find an option to make it work. Is there some option like $smwgNamespacesWithSemanticLinks from Semantic Media Wiki or a magic word to ignore any #cargo_store ?

Thank you ! DSwissK (talk) 15:00, 14 June 2020 (UTC)


 * Great site! I'm not sure I understand: are you worried that a page like "Dico:Mot de la semaine/2020/24" will show up in the database as a word? If so - are you planning to copy the contents of the word's page into the "word of the week" page, or to instead use #cargo_query with the "embedded" format, as you are doing now with #ask? Yaron Koren (talk) 19:15, 14 June 2020 (UTC)


 * Thank you for the kind words. Exactly, I don't want "Dico:Mot de la semaine/2020/24" to show up in the database as a word since it's already there. (Word of the week is picked among the words that are already created and stored in Cargo.)
 * I did try with #cargo_query instead but, as you can see, if you search for "évaluation des", you get 2 "words" ("test" and "Mot de la semaine/2020/26"). Any workaround idea ? DSwissK (talk) 20:00, 14 June 2020 (UTC)


 * If the "embedded" format causes a page to get the Cargo values of the page(s) that it embeds, that's a problem. Maybe there is a fix for that - I don't know. Until then, I suppose you can get around this problem by adding " AND _pageNamespace = 0" to the "where" parameter in every #cargo_query call, as annoying as that sounds. Yaron Koren (talk) 03:14, 15 June 2020 (UTC)
 * Right. I'll use this solution until then. :) Thanks. DSwissK (talk) 12:42, 15 June 2020 (UTC)
 * Here is the solution we came accross :  (on the template page) if that might help anyone. :) DSwissK (talk) 21:05, 15 June 2020 (UTC)

Unable to use Parser Functions or Conditional Expressions on List Output
Greetings, I've been able to create a List Cargo_query which looks up and returns a single output, for example look up a species by Name in the cargo_table and return only its Genus, but am unable to do anything but display the output. All attempts to use the output in a parser function or conditional expression fail, acting like nothing is being passed into them. By using padleft on the output, I can see that 16 invisible characters are getting added to the output, but am unable to see what they might be. Using #pos: on the output doesn't show any actual text being output, indicating only a pointer to the cargo data is being returned instead of returning the stored string data itself. Is there anything I can add to my cargo_query to get rid of those extra invisible characters so that I can use the output like a proper string for #ifeq checks? Thank you, Ertosi 10:29, 18 June 2020 (UTC)


 * If Genus is your list field, you can get Genus__full from the cargo query instead of Genus, and use it in your own templates/parser functions. Jonathan3 (talk) 12:09, 18 June 2020 (UTC)


 * Adding "|no html" to the #cargo_query call will hopefully fix the problem. Yaron Koren (talk) 14:10, 18 June 2020 (UTC)


 * Thank you so much, "|no html" was exactly what I was looking for! I gave it a try and everything is working now. I haven't tried the "__full" option yet, but appreciate that suggestion as well. Yaron Koren, I'm really enjoying Cargo as the potential for it is endless. The "|no html" option was the last ingredient I needed to finish making semiautomated pages for my wiki that fill themselves out after their infobox is completed and I'm looking forward to the time it's going to save. Thanks again, your hard work contribution to the wiki community is greatly appreciated. Ertosi 21:19, 18 June 2020 (UTC)

"Page values" link missing from tools menu in sidebar
I have two wikis use Cargo 2.6 (042d05d) 02:00, 2020 June 11; they no longer show the "page values" links in the tool bar. Two other wikis using Cargo 	2.5 (4a45c7a) 2020-05-05T13:08:00 still show the page values link. If I add "&action=pagevalues" to the URL I can still see the page values. I don't see a note in Extension:Cargo/Version_history that the link was removed. How can I get the link back? Tenbergen (talk) 20:11, 24 June 2020 (UTC)


 * Yes, there was a change about two weeks ago to use a different hook to add the "Page values" link. Somehow, I checked in the patch without actually testing it out! My guess is that it works for MediaWiki 1.35, but not for older versions, so I'll have to change how this code gets called. I should note that this change was made after Cargo 2.6 came out (the next day, actually), so if you use the official Cargo 2.6 code, that sidebar link should work fine. Yaron Koren (talk) 01:37, 25 June 2020 (UTC)


 * Okay, I just checked in a fix for this. Yaron Koren (talk) 15:54, 25 June 2020 (UTC)


 * Works in newest version, thanks for the fix, Yaron! Tenbergen (talk) 20:14, 9 July 2020 (UTC)

Cargo results and "What links here"
When my Cargo query returns one page name (page B) in the default list format, which displays as a wiki link on page A, that wiki link does not cause page A to show up in the "What links here" list of page B. It's not a problem, as using "template" format instead, where the template just has does make page A show up in the "What links here" of page B. I just thought I might mention it here in case anyone is searching for a solution! Thanks again for a great extension. Jonathan3 (talk) 15:06, 1 July 2020 (UTC)
 * Thanks for the hint about the template format for fixing the what-links-here. I had noticed that links generated by cargo queries don't show up in the what-links-here, and thought it was just something I'd have to live with. I wonder if there is a sensible place in the main documentation pages to put this. The template format maybe? Tenbergen (talk) 20:14, 9 July 2020 (UTC)

Field _lastUploadDate in table _fileData doesn't update
I have a set of pictures of which we re-upload new versions several times a week. We have a table that lists these files, and their last upload. The date in that field doesn't update when a new version is uploaded. Turns out that the Cargo table when viewed from special pages doesn't update either. If I run php setCargoFileData.php to fix the table, the data in the table is then right. The table on the page still doesn't update until I click the mediawiki refresh tab. Should this update automatically, or do I need cron jobs to regularly run php setCargoFileData.php? Tenbergen (talk) 20:14, 9 July 2020 (UTC)


 * Are the uploads done "manually", or using some kind of bot? Yaron Koren (talk) 20:46, 9 July 2020 (UTC)
 * Uploads are done manually. Tenbergen (talk) 04:39, 25 July 2020 (UTC) Should it make a difference? Tenbergen (talk) 23:34, 28 July 2020 (UTC)
 * If this is just how it works, then should I run php setCargoFileData.php as a nightly cron job? Tenbergen (talk) 21:24, 12 August 2020 (UTC)


 * Sorry for the delay. I finally looked into this, and indeed Cargo did not update the _fileData table on a re-upload. I checked in a fix for this, so if you get the latest code, I think this problem will go away. Yaron Koren (talk) 20:00, 13 August 2020 (UTC)
 * I pulled down the newest version and it updates _lastUploadDate correctly now. Thanks for your patience with my persistence, and THANK YOU for the fix. Tenbergen (talk) 21:11, 13 August 2020 (UTC)

Every Date after 27-12 (include) in every year will be stored as the next year
Hi, Im using cargo 2.0.1.

I saw a problem that i can reproduce with open new table (2 fields, one of them is Date).

I store this value in the Date field=28-12-1957 and when i query\see this table the saved date is: 28-12-1958.

Tried also:
 * year > 2000
 * Insert the date as: 1957-28-12

TY — Preceding unsigned comment added by Koshob (User talk:Koshob • Special:Contributions/Koshob) 22:48, 2 August 2020‎ (UTC)


 * This might have been fixed already. Could you try using the latest version of Cargo? Yaron Koren (talk) 00:16, 3 August 2020 (UTC)

Koshob (talk) 21:13, 3 August 2020 (UTC) Indeed, ty!

Conditional formatting tables
I Have a table with different color hexcodes in table cells. Is it possible to make the backgroundcolor of a tablecell so to match the code for each cell? Something like: style=background: #c6bdab | DGWKJacobs (talk) 10:42, 10 August 2020 (UTC)


 * Are you asking about the Cargo "template" format? Yaron Koren (talk) 13:53, 10 August 2020 (UTC)


 * Its about a cargo query with table as display format. I am trying:


 * Unfortunately, I don't think there is any way to set the formatting of cells in the the "table" format. You might have to instead manually (more or less) create the table, using the "list" or "template" formats. Yaron Koren (talk) 20:17, 13 August 2020 (UTC)


 * I nested the cargoquery with template as displayresult inside the wikitable syntax: DGWKJacobs (talk) 02:00, 28 August 2020 (UTC)


 * The template Colortable defines the body of the table:


 * || ||  || style='background: #' | # || style='background: #' | # || style='background: #' | # || style='background: #' | # || style='background: #' | #

Error: table “Level” not found
See also phab on miraheze.

The template located at Template:关卡信息 defined a Cargo table "Level". However, when visiting Special:CargoTables/Level, it reads: Error: table Level not found. And Special:CargoTables shows nothing. If I re-create the table, it doesn't help.

I also created some sandbox tables like Template:Sandbox and Template:沙盒, and the same thing happens.

The error message provides no details. It's unlikely to set $wgShowExceptionDetails according to Miraheze stewards and actually the detail is the same as a table that really does not exist.

--SolidBlock (talk) 10:55, 17 August 2020 (UTC)


 * Yes, clearly the table was not created - your Special:CargoTables page shows no tables. Somehow the "create table" command failed - maybe because the template name contains non-ASCII characters, I don't know. Did you try creating the table from the web interface, or the command line? Whichever one you tried, I would try the other one. Yaron Koren (talk) 15:29, 17 August 2020 (UTC)
 * I created the table via the interface label near the "view/edit/history". Maybe due to non-ascii characters, but Template:Sandbox is also wrong. And the parser function #cargo_declare shows the table is defined (unless the table is really not defined). ——SolidBlock (talk) 15:53, 17 August 2020 (UTC)


 * Oh, I didn't notice that you mentioned the "Sandbox" template as well. Yes, that one looks totally non-ASCII - and all the calls in it look fine. And you probably don't have command-line access, unfortunately. Here is what you should do: go again to one of those templates, "inspect" the page by right-clicking and then go the "Network" tab, and follow the process again to create the table. The last URL in the "Network" tab is the API page that actually does the table creation; if you go to that URL, you might be able to see a more helpful error message. Yaron Koren (talk) 16:59, 17 August 2020 (UTC)


 * I did what you said to, and got the following messages:
 * https://rs.miraheze.org/w/api.php?action=cargorecreatedata&table=Sandbox&template=Sandbox&offset=0


 * https://rs.miraheze.org/w/api.php?action=cargorecreatetables&template=Sandbox


 * --SolidBlock (talk) 00:50, 18 August 2020 (UTC)


 * Alright - here is indeed a case where being able to see the exception details would be helpful. My only guess right now is that the database tables cargo_tables and cargo_pages were never created for this wiki (update.php needs to be called to create them). Is that possible? Yaron Koren (talk) 01:07, 18 August 2020 (UTC)
 * I don't think so...I don't know how to call update.php. SolidBlock (talk) 01:50, 18 August 2020 (UTC)
 * I meant, is it possible that that's the issue. Yaron Koren (talk) 03:53, 18 August 2020 (UTC)
 * I see "Error: 1054 Unknown column 'field_helper_tables' in 'field list' (db11.miraheze.org)" in the logs. RhinosF1 (talk) 08:48, 18 August 2020 (UTC)
 * Aha! That's helpful. The column field_helper_tables was added in 2017. So clearly either this database, or the code you are using to install Cargo on a new wiki, are from before then. You just need to update the DB, or the code, or both, and then hopefully everything will work. Yaron Koren (talk) 14:10, 18 August 2020 (UTC)
 * I will inform miraheze stewards. They may be able to help do that. --SolidBlock (talk) 14:28, 18 August 2020 (UTC)
 * It's fiexd now. Thanks for your help. --SolidBlock (talk) 03:34, 23 August 2020 (UTC)

timeline error - Caught exception: SyntaxError: Unexpected token '<'
Hi, I´m new to Cargo and running a private wiki on Windows 7 64-bit with Xampp 7.4.7. I'm getting the above error when trying to see timeline displayed on Drilldown and also when I try to use it as a display format of #cargo_query. After some research I have found this 2018 post about what seems to be a similar problem: 1.timeline causing error

However, the sugested fix didn´t work for me (installing MagicNoCache extension and adding "__NOCACHE__", on a line by itself, to any page that calls the "timeline" format.). The same error message remains...


 * Caught exception: SyntaxError: Unexpected token '<'

Even if the fix worked, I wouldn´t be able to use it on Special Page drilldown, since, as far as I can see, it's not possible to edit this page to add the magic word. I wonder if it has some relation to previously installed SMW or the Modern Timeline or Semantic Bundle extensions on my wiki. Before I discovered Cargo...

My installed software are recent versions, but my system Windows OS is perhaps a bit outdated...


 * MediaWiki	1.34.1
 * PHP	7.4.7 (apache2handler)
 * MariaDB	10.4.13-MariaDB
 * Page Forms	4.9.5
 * Cargo	2.6
 * Page Schemas	0.5.1

PS: When I try to use the Cargo Query Special Page, it displays the query correctly, except for the error message

ErrorException from line 106 of C:\xampp\htdocs\mediawiki\extensions\Cargo\includes\CargoQueryDisplayer.php: PHP Notice: Trying to access array offset on value of type null

This line of code reads

$tableName = $this->mFieldTables[$fieldName];

I suspect it is somehow connected to the problem...

Any help would be much appreciated!

csv export
Hello, I have a one cargo table. I have a multiple instances template and a main template.

Is it possible to get my csv export to contain all my fields to populate one row? My multiple instance data populates a separate row and my main template data populate another row. Note, I am using a cargo_query:

Program Name is from the main template. Thank you for your wonderful tool! Regards, Margaret


 * I don't understand - you have two templates but only one Cargo table? Yaron Koren (talk) 22:31, 31 August 2020 (UTC)


 * Yes, One Cargo table and two templates. The main template and a multiple instance template that attaches to the table.


 * If I understand it correctly, these two templates each have a different set of fields. If that's the case, they should each have their own Cargo table - defining them together provides no benefit. If you want to then display them together, use "join on". Yaron Koren (talk) 13:53, 2 September 2020 (UTC)