Extension talk:Cargo

Latest comment: 3 hours ago by Tahoma403 in topic Order by and empty values

[SOLVED] Events on Sunday 1st of any month do not appear on that month's calendar

edit

Create any event which is both a Sunday and the 1st of the month and display it using the calendar (month) output format.

Using the example of Sunday 1 December 2024 - the event will be displayed at the end of the November 2024 page, but will not be displayed at the start of the December 2024 page.

Can we fix this within Cargo? Or is it a problem with https://fullcalendar.io/ ? Jonathan3 (talk) 09:51, 4 October 2024 (UTC)Reply

That is curious. Does it appear properly in week or day format?
I would have to guess it’s more how data is translated into fullcalendar.io coding. You have tried creating a test entry in other dates than Dec 1, 2024, and multiple entries on the Dec 1? Geoff3ds (talk) 22:07, 4 October 2024 (UTC)Reply
Other dates show fine.
Multiple events on 1 Dec 24 - none display properly. Jonathan3 (talk) 22:10, 4 October 2024 (UTC)Reply
Sorry, I meant other dates on the first of a month which is a Sunday. Beyond Dec 1. Geoff3ds (talk) 22:18, 4 October 2024 (UTC)Reply
Other dates that are a Sunday and are the 1st of the month are the same. I just used 1 Dec 24 as an example. Jonathan3 (talk) 13:43, 5 October 2024 (UTC)Reply
Which version of Cargo extension are you running? Geoff3ds (talk) 14:31, 5 October 2024 (UTC)Reply
I am using MW 1.39.6 and the latest version of Cargo. Jonathan3 (talk) 12:36, 7 October 2024 (UTC)Reply
@Yaron Koren Any ideas on this? Thanks. Jonathan3 (talk) 15:01, 11 October 2024 (UTC)Reply
Sorry about that - this was actually a problem with the first day shown on any calendar (which is always a Sunday), regardless of whether it's the first of the month. I just checked in a fix for it. Yaron Koren (talk) 18:17, 11 October 2024 (UTC)Reply
This works! Thanks. Jonathan3 (talk) 22:15, 11 October 2024 (UTC)Reply

Unable to get any events to appear in a calendar (solved)

edit

I have created a table, using {{#cargo_declare:_table=Tests|Type=String|Date=Date|Start=Date|End=Date|description=Text}} and populated it with a few rows of data. It displays well in lists and table formats, but trying to call it for a calendar, {{#cargo_query:tables=Tests|fields=_pageName,Date,Type|format=calendar|width=100%}}

I get a calendar that is empty. The items in there have dates in format 2024-10-10  , 2024-10-01 , etc.

Is there any obvious mistake in what I’ve done that the calendar format needs? I have a table Events that I started with and got nowhere, trying to call it as {{#cargo_query:table=Events|fields=Eventname=name,Date|format=calendar|width=100%}}

I’ve tried studying the examples in the documentation, but I’ve gotten no idea how calendars might work or how I can troubleshoot what is going wrong. Geoff3ds (talk) 21:59, 4 October 2024 (UTC)Reply

Maybe you can't call a field Date? Jonathan3 (talk) 22:06, 4 October 2024 (UTC)Reply
Checked, the first example showed it using Author, Date, Source, etc. I tested without Date, maybe that was removed as option in later versions. I wish I had more examples to review (and more documentation). Do you know any source of examples or documentation relating to calendar beyond the extension page on this site?
Also, if you might provide table structure of what you might use that’s working? Geoff3ds (talk) 22:16, 4 October 2024 (UTC)Reply
Maybe start from scratch with the bare minimum, e.g. a table Events_test with only fields Event_name (String) and Event_date (Date), and see whether that works. Jonathan3 (talk) 12:39, 7 October 2024 (UTC)Reply
Calling Start and End fields but not Date hasn’t solved getting a single item to display. Geoff3ds (talk) 22:22, 4 October 2024 (UTC)Reply
The "calendar" format works for me. Could you look in the browser console to see if there are any JS errors? If you don't see any errors, try looking in the "Network" tab (if you see such a thing) and click to different months - each one should have its own URL, and going to any such URL may show something relevant. Yaron Koren (talk) 21:18, 6 October 2024 (UTC)Reply
Looking into the console did help alert me to the problem, which if you ever want to include on a FAQ may save someone from the unlikely problem I created for myself:
I installed the wiki on my site, and then later added a secure certificate. Because the site address in LocalSettings.php had the $wgServer of my site without the s in https, any web browser was throwing errors when trying to call javascript to run the table.
https site calling http address because the $wgServer needed to be corrected. Geoff3ds (talk) 20:59, 9 October 2024 (UTC)Reply
Good news! I've heard of that problem happening before, although I don't remember if it was in the context of Cargo or some other extension (or core MediaWiki). Maybe it makes sense to add something about this to the "Common problems" page. Yaron Koren (talk) 15:43, 10 October 2024 (UTC)Reply

Deprecated: Linker::tocIndent

edit

Hello! I am getting the following deprecation notice with MediaWiki 1.42.3 and Cargo 3.5.1 (903d10b):

Deprecated: Use of MediaWiki\Linker\Linker::tocIndent was deprecated in MediaWiki 1.42. [Called from CargoPageValues::execute in /var/www/html/extensions/Cargo/includes/specials/CargoPageValues.php at line 56] in /var/www/html/includes/debug/MWDebug.php on line 379

I wanted to raise this as I'm already on REL1_42 which should be the compatible version for my MediaWiki install. Please let me know if there is anything that I can fix on my end here. Mpvlewis (talk) 18:08, 8 October 2024 (UTC)Reply

I think this has already been fixed - you should switch to the master branch. More generally, you shouldn't use any of the REL... branches for Cargo. Yaron Koren (talk) 19:16, 8 October 2024 (UTC)Reply

Deleting table using CargoTables page doesn't always work properly

edit

I deleted a table but its template page says 'Edit the page to see the template text. This template defines the table "tablename". View table.'

When I click "view table" it says "Error: Table tablename not found." Jonathan3 (talk) 09:52, 11 October 2024 (UTC)Reply

I deleted the various helper tables that had not been deleted by Cargo automatically, and purged the cache of the Template page, and it works now, so as usual I don't know what fixed the problem. Probably just purging the cache. Jonathan3 (talk) 10:00, 11 October 2024 (UTC)Reply
The fact that some helper tables were not deleted is a problem. Which types of helper tables were not deleted, do you remember? Yaron Koren (talk) 13:33, 11 October 2024 (UTC)Reply
Unfortunately I can't remember them all. Most related to list fields, though. Jonathan3 (talk) 14:30, 11 October 2024 (UTC)Reply

Have custom formatting within #cargo_query instead of needing separate template

edit

I can't remember whether I've asked for this before. But it would be great to be able to do this, especially for what now are fairly simple templates. It would sometimes save having to create a template at all. Jonathan3 (talk) 22:39, 11 October 2024 (UTC)Reply

If the formatting is simple enough, you might be able to do it directly in the query, using CONCAT(). Yaron Koren (talk) 23:04, 11 October 2024 (UTC)Reply

[SOLVED] Problem with "intro=" introduced between REL1_42 and master

edit

The effect of a change between REL1_42 and master means the intro= parameter isn't creating a table properly.

This:

|intro=
{{{!}} class="wikitable sortable"

Turns into <table class="wikitable sortable"> on REL1_42. But on master it turns into:

<table class="&quot;wikitable">

Jonathan3 (talk) 23:47, 12 October 2024 (UTC)Reply

I just checked in a patch that I think fixes this, among other issues. Yaron Koren (talk) 18:33, 14 October 2024 (UTC)Reply
This works. Thank you. Jonathan3 (talk) 20:58, 14 October 2024 (UTC)Reply

API: Field names starting with an underscore (_pageName, _pageID, ...) only work if a display name is set (e.g. fields=_pageName=pageName)

edit

The title above is a quotation from a previous topic here: Extension_talk:Cargo/Archive_January_to_February_2018#API_improvements.

I'm glad the topic is still there as it's still necessary to do this, but I couldn't find it documented anywhere. Jonathan3 (talk) 18:59, 13 October 2024 (UTC)Reply

It's there in "Common problems". Yaron Koren (talk) 18:14, 14 October 2024 (UTC)Reply
So it is. Thanks. It would be good to have it also (or instead) here: Extension:Cargo/Exporting_data#API. Jonathan3 (talk) 21:00, 14 October 2024 (UTC)Reply

Problem when field value contains one of the "List" field names

edit

Cargo query:

{{#cargo_query:tables=A
|where=Field1="qwertyuiop Field2 asdfghjkl" 
}}

Error: Error: operator for the virtual field 'A.Field1' must be 'HOLDS', 'HOLDS NOT', 'HOLDS LIKE' or 'HOLDS NOT LIKE'.

  • Where Field1 appears above - it happens for any field.
  • Where Field2 appears above - it happens for "List (,) of String" and "List (,) of Page" fields but not for normal Text or String fields. It only happens when the field name has space characters on both sides.

Jonathan3 (talk) 20:45, 13 October 2024 (UTC)Reply

This is quite an annoying problem. It means, for instance, if you have Author as a field in your Books table, you can't have a book called "Advice to the Author", or if you have a field called Price then you can't have a book called "The Price is Right", because every Cargo query using that title in a string within the WHERE clause will cause an error.
@Yaron Koren Would you like any more information? Thank you in anticipation. Jonathan3 (talk) 21:43, 24 October 2024 (UTC)Reply
I agree that it's annoying, but you could always use the "PAGEID" magic word instead of "PAGENAME", no? Yaron Koren (talk) 15:20, 25 October 2024 (UTC)Reply
I'm afraid not. The problem arises no matter which field is field1 above. The error occurs when the name of a list field name is used within thr query. Jonathan3 (talk) 16:21, 25 October 2024 (UTC)Reply

[SOLVED] Best way of displaying individual values only once from list field

edit

Let's say we have an Editions table (for books), and a List (,) of String Author field. Edition 1 has authors A, B while Edition 2 has Authors B and C. For all the book's authors, how can I return "A, B, C" rather than "A, B, B, C"? I'm having a mental block and no doubt it will seem easy when I see it! Jonathan3 (talk) 22:32, 15 October 2024 (UTC)Reply

You might have to query the list helper table (e.g., Editions__Author), with "group by=". Yaron Koren (talk) 15:02, 16 October 2024 (UTC)Reply
That worked! Thank you. Jonathan3 (talk) 22:22, 16 October 2024 (UTC)Reply

Lua and embedded multi-instance templates, and dealing with list fields

edit

I'm able to get data from a Cargo table all right, using the example provided - but to save me reinventing the wheel, do you have an example of using Lua to get (and use) all of the data from a Cargo table including data from another table used by the PF embedded multi-instance template?

Also, I found a short function to "explode" a Cargo list field into an array of its constituent parts, but I imagine there's a better way of dealing with Cargo list fields.

Thanks in advance!

@RheingoldRiver, I hope you don't mind me pinging you, but I remember you talking about Cargo and Lua on the Between the Brackets podcast. Jonathan3 (talk) 23:45, 19 October 2024 (UTC)Reply

I have a couple blog posts that might help, on list fields and on representing one-to-many functions. Specifically in Lua, yes, you will need to use mw.text.split. Looking at my Cargo wrapper on Leaguepedia might help although it hasn't been maintained by me for a while, and it has a bunch of complex and unnecessary operations if you have GROUP_CONCAT available to you (which you should). --RheingoldRiver (talk) 04:51, 20 October 2024 (UTC)Reply
Thanks for the swift response. I'll read that now. In the meantime I've asked a question about mw.text.split on Extension_talk:Scribunto at Topic:Yelw4qke5vomdp5y. Jonathan3 (talk) 20:01, 20 October 2024 (UTC)Reply

I'm looking at this again. Initially I got the data from an embedded multi-instance template by using a Cargo query within a Lua module. But would it not be possible to get the data directly from the template parameter? It's easy enough to get the other parameters. Essentially, I wonder how to get the edition details from something like this:

{{Book
|...
|Edition={{Edition|number=1|year=2000}}{{Edition|number=2|year=2005}}
|...
}}

Thanks. Jonathan3 (talk) 07:16, 21 December 2024 (UTC)Reply

I've tried a few things and it seems that there's no way to do this, as the embedded template gets expanded before the main template gets to see it. Manual:Advanced_templates#Templates_passed_as_parameters seems to be conclusive on that. Jonathan3 (talk) 08:31, 21 December 2024 (UTC)Reply

[SOLVED] Max display character for format=template (Show/Hide feature for long Wikitext)

edit

Hello. I tried to implement the "max display char" feature for query results (Show/Hide for long Wikitext, similar to Special:CargoTable/View Table), however haven't successful.

Searching on Archive, it seems that the issue is because "max display char" is not applicable for format=template.

Extension talk:Cargo/Archive April to July 2019#c-Yaron Koren-2019-07-19T13:40:00.000Z-Shuitavsshente-2019-07-19T08:36:00.000Z

I also tried to manual implement it, but was still not successful.

- Load Cargo.js https://github.com/wikimedia/mediawiki-extensions-Cargo/blob/3d972d59d6bddf3f3b5a15d90aee7a87e78b0841/libs/Cargo.js

- Assign <td><span class="cargoMinimizedText" style="display: none;"><p>Long Wikitext here</p></span></td>

Can you please help where I did wrong? Thank you.

Duyhungwiki (talk) 10:32, 26 October 2024 (UTC)Reply

Is there a way to do this within the template, using parser functions and/or a custom widget (i.e., via the Widgets extension)? Yaron Koren (talk) 22:27, 30 October 2024 (UTC)Reply
@Yaron Koren I managed to do it successfully, by exact Cargo code to Gadget and Template.
My step is below for anyone needed:
Gadgets:
var showText = '[Show]';
var showPseudoLink = $( '<a>' ).addClass( 'cargoToggle' ).text( showText );
var hideText = '[Hide]';

$('span.cargoMinimizedText')
	.hide()
	.parent().prepend( showPseudoLink );

$('a.cargoToggle').click( function() {
	if ( $(this).text() == showText ) {
		$(this).siblings('.cargoMinimizedText').show(100).css('display', 'inline');
		$(this).text(hideText);
	} else {
		$(this).siblings('.cargoMinimizedText').hide(100);
		$(this).text(showText);
	}
});
Template to add outside "Show more" text and inside <td> </td> of the table
{{#ifexpr: {{#invoke:String|len|{{{1|}}}}} >= 300
|<span class="cargoMinimizedText">

{{{1|}}}</span></td>|{{{1|}}}}}
Duyhungwiki (talk) 15:29, 6 November 2024 (UTC)Reply
That's great! I think you meant "by copying". I'm glad you were able to do it with a combination of JavaScript, Lua and ParserFunctions. Yaron Koren (talk) 16:22, 6 November 2024 (UTC)Reply

Error for cargoRecreateData.php

edit

Hello, I hope you can help me figure out why cargoRecreateData.php stopped working. It was working fine, but without any changes that I can think of other than users entering data into forms, it started throwing the error below.

From the terminal, or at least what my website management API tells me:

"Recreating data for Cargo table Hausstätte in 5 seconds... hit [Ctrl]-C to escape.

Deleting and recreating table...

Handling template that adds to this table: Hausstätte info

Saving data for pages 1 to 500 that call this template...

Saving data for pages 501 to 1000 t..."

Note: there are more than 1000 pages that call Hausstätte_info

The more detailed backtrace:

[6e8fbaa2730a68080cf9692f] [no req] Error: Call to a member function exists() on null Backtrace: from /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageForms/includes/parserfunctions/PF_TemplateDisplay.php(205)

  1. 0 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageForms/includes/parserfunctions/PF_TemplateDisplay.php(123): PFTemplateDisplay::pageText()
  2. 1 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3371): PFTemplateDisplay::run()
  3. 2 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3056): Parser->callParserFunction()
  4. 3 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/PPFrame_Hash.php(274): Parser->braceSubstitution()
  5. 4 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3247): PPFrame_Hash->expand()
  6. 5 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/PPFrame_Hash.php(274): Parser->braceSubstitution()
  7. 6 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(2888): PPFrame_Hash->expand()
  8. 7 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(1544): Parser->replaceVariables()
  9. 8 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(651): Parser->internalParse()
  10. 9 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/includes/CargoUtils.php(605): Parser->parse()
  11. 10 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(171): CargoUtils::parsePageForStorage()
  12. 11 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(72): CargoRecreateData->recreateAllDataForTable()
  13. 12 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/maintenance/includes/MaintenanceRunner.php(703): CargoRecreateData->execute()
  14. 13 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/maintenance/doMaintenance.php(100): MediaWiki\Maintenance\MaintenanceRunner->run()
  15. 14 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(180): require_once(string)
  16. 15 {main}

In effect, it does recreate the table and I can see that complete table in the wiki with more than 1000 rows. Dumpstar (talk) 18:36, 30 October 2024 (UTC)Reply

What versions of MediaWiki, Cargo and Page Forms are you running? Yaron Koren (talk) 20:14, 30 October 2024 (UTC)Reply
MediaWiki 1.41.0
Cargo 3.5
Page Forms 5.7 Dumpstar (talk) 20:36, 30 October 2024 (UTC)Reply
Okay - those versions of Cargo and Page Forms are not that old, but they're somewhat old. Could you try switching to the latest version of both, and see if it works better? At the very least, the line numbers will be different. Yaron Koren (talk) 22:30, 30 October 2024 (UTC)Reply
I did try. I updated to Mediawiki 1.42 and installed the versions for 1.42 for Cargo and PageForms. I received this message when executing cargoRecreateData.php:
PHP Deprecated: Use of wfGetDB was deprecated in MediaWiki 1.39. [Called from PageAuthors::getPageAuthors in /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageAuthors/PageAuthors.php at line 67] in /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/debug/MWDebug.php on line 379
[35df5d9d2064831551a463ac] [no req] Error: Call to a member function exists() on null
Backtrace:
from /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageForms/includes/parserfunctions/PF_TemplateDisplay.php(219)
  1. 0 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageForms/includes/parserfunctions/PF_TemplateDisplay.php(137): PFTemplateDisplay::pageText()
  2. 1 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3451): PFTemplateDisplay::run()
  3. 2 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3136): MediaWiki\Parser\Parser->callParserFunction()
  4. 3 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/PPFrame_Hash.php(275): MediaWiki\Parser\Parser->braceSubstitution()
  5. 4 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3327): PPFrame_Hash->expand()
  6. 5 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/PPFrame_Hash.php(275): MediaWiki\Parser\Parser->braceSubstitution()
  7. 6 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(2970): PPFrame_Hash->expand()
  8. 7 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(1620): MediaWiki\Parser\Parser->replaceVariables()
  9. 8 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(722): MediaWiki\Parser\Parser->internalParse()
  10. 9 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/includes/CargoUtils.php(608): MediaWiki\Parser\Parser->parse()
  11. 10 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(171): CargoUtils::parsePageForStorage()
  12. 11 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(72): CargoRecreateData->recreateAllDataForTable()
  13. 12 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/maintenance/includes/MaintenanceRunner.php(698): CargoRecreateData->execute()
  14. 13 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/maintenance/doMaintenance.php(100): MediaWiki\Maintenance\MaintenanceRunner->run()
  15. 14 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(180): require_once(string)
  16. 15 {main}
However, there also seem to be other issues with my wiki, or the 1.42.3 upgrade, because several functions would not work anymore. May be a PHP issue. I rolled it back for now. Have to figure that out. Dumpstar (talk) 01:14, 3 November 2024 (UTC)Reply
Sorry I wasn't clear before - please use the latest version of these two extensions, not the version/branch that corresponds to whatever MediaWiki version you're using. (Those are generally worthless.) Yaron Koren (talk) 15:53, 3 November 2024 (UTC)Reply
Sorry for the late reply. I updated to the current master of Cargo and PageForms. I still get this error message, even though it seems to produce the data tables just fine.
[7df6d1c0f5e7a4e18d530ee1] [no req] Error: Call to a member function exists() on null
Backtrace:
from /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageForms/includes/parserfunctions/PF_TemplateDisplay.php(219)
  1. 0 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/PageForms/includes/parserfunctions/PF_TemplateDisplay.php(137): PFTemplateDisplay::pageText()
  2. 1 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3371): PFTemplateDisplay::run()
  3. 2 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3056): Parser->callParserFunction()
  4. 3 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/PPFrame_Hash.php(274): Parser->braceSubstitution()
  5. 4 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(3247): PPFrame_Hash->expand()
  6. 5 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/PPFrame_Hash.php(274): Parser->braceSubstitution()
  7. 6 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(2888): PPFrame_Hash->expand()
  8. 7 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(1544): Parser->replaceVariables()
  9. 8 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/includes/parser/Parser.php(651): Parser->internalParse()
  10. 9 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/includes/CargoUtils.php(614): Parser->parse()
  11. 10 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(171): CargoUtils::parsePageForStorage()
  12. 11 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(72): CargoRecreateData->recreateAllDataForTable()
  13. 12 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/maintenance/includes/MaintenanceRunner.php(703): CargoRecreateData->execute()
  14. 13 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/maintenance/doMaintenance.php(100): MediaWiki\Maintenance\MaintenanceRunner->run()
  15. 14 /var/www/vhosts/lippe-haeuser-wiki.de/httpdocs/extensions/Cargo/maintenance/cargoRecreateData.php(180): require_once(string)
  16. 15 {main}
Dumpstar (talk) 12:38, 3 December 2024 (UTC)Reply
Thanks, that's helpful. I just added a fix for this to the Page Forms code - if you re-get the latest Page Forms code (and call "recreate data' again), hopefully that error message will go away. Yaron Koren (talk) 14:50, 3 December 2024 (UTC)Reply
That seems to have done the trick! Thank you very much! Dumpstar (talk) 21:19, 4 December 2024 (UTC)Reply

Autocomplete with aliases in page forms

edit

I'm just learning about Cargo, and have watched your Youtube video on Ben Fletcher's channel. I really like the token suggestion feature.

One concern I have is what I see with a similar feature on a forum I use. People make different tags for synonyms or different spellings of the same word (e.g. "CBT", "cognitive behavioral therapy", "cognitive-behavioral therapy", and "cognitive behavioural therapy"). Different people put different tags for the same thing.

I wonder if it'd be possible to have "aliases" for tokens. Where I might store "CBT" as an alias for "cognitive behavioral therapy", so that if I start typing the former, the latter appears in suggestions. And maybe if I submit the former as is, it is equivalent to submitting the latter. (Though maybe not in this case since CBT can be an acronym for many things.) Dimpizzy (talk) 13:39, 1 November 2024 (UTC)Reply

This is a valid question, but it's for the Page Forms extension - please ask it on that extension's talk page. Yaron Koren (talk) 15:21, 1 November 2024 (UTC)Reply

Concat gives error "Identifier must not contain quote, dot or null characters"

edit

I have a bunch of queries that use Concat to mix field output and formatting text. This used to work, but now I get an error "Identifier must not contain quote, dot or null characters" for any text that is in there. For example, ...fields=CONCAT(_pageName,awardYear)... gives a result, but ...fields=CONCAT("i")... gives an error.

I just updated this wiki to (MW1.43.0, Cargo 3.5.1 (a94c697) 2024-12-12T15:25:01, PHP 8.3.14, MySQL 8.0.32-0ubuntu0.20.04.2); I am pretty sure it was working before. In addition to updating the wiki I also updated PHP, it was 8.1 or 8.2 before. Tenbergen (talk) 01:36, 21 December 2024 (UTC)Reply

Order by and empty values

edit

I have a table of items with an optional field to add a sort key (integer). Can I sort the items without a sort key at the bottom instead of at the top?

Table (_pageName/SortKey):

Austria |
Belgium | 2
Cyprus |
Denmark |
England | 1

Desired sorting:

England
Belgium
Austria
Cyprus
Denmark

Tahoma403 (talk) 04:11, 22 December 2024 (UTC)Reply

Return to "Cargo" page.