Page MenuHomePhabricator

Add option to skip structured data parts in upload wizard campaigns
Closed, ResolvedPublic

Description

The campaigns extension of the upload wizard offers you the option to skip all sorts of steps in the UploadWizard. Often we skip the intro and we just offer one license + own work. This is done to make uploading very efficient and easy (not too many options).

UploadWizard was extended to support structured data on Commons, but the campaigns extension hasn't been updated yet to be able to disable parts if these are redundant. Options to add:

  • Ability to disable captions
  • Ability to disable statements addition
  • Ability to complete skip the structured data step

Acceptance criteria:
enabled settings in the campaign config

  • wikibase.enabled == false: captions input absent, metadata step absent
  • wikibase.enabled == true, wikibase.captions == true, wikibase.statements == false: captions input boxes present, metadata step absent
  • wikibase.enabled == true, wikibase.captions == false, wikibase.statements == true: captions input boxes absent, metadata step present
  • wikibase.enabled == true, wikibase.captions == true, wikibase.statements == true: captions input boxes present, metadata step present

Event Timeline

Change 529373 had a related patch set uploaded (by Cparle; owner: Cparle):
[mediawiki/extensions/UploadWizard@master] Adjustments to campaign schema for structured data

https://gerrit.wikimedia.org/r/529373

@Multichill this already works in master. I don't have permission to create a campaign to check it on production - do you?

Change 529373 abandoned by Cparle:
Adjustments to campaign schema for structured data

Reason:
Now that I understand the campaign schema better, I realise we don't need this

https://gerrit.wikimedia.org/r/529373

I tested this today on Beta Commons and had a weird experience. TL;DR - this all seems to work fine but I did initially have a problem with descriptions suddenly becoming optional instead of required. I could not replicate this on further testing though.

Here's what I got the first time I used "enabled":false for the Wikibase object

uploadwiz-screen.PNG (536×955 px, 135 KB)

For reference, here's the full JSON I used:

{
    "enabled": true,
    "display": {
        "headerLabel": "Campaign!",
        "thanksLabel": "Thanks for uploading!"
    },
    "defaults": {
        "categories": [
            "California Historical Landmarks"
        ]
    },
    "autoAdd": {
        "wikitext": "AutoAdd test"
    },
    "licensing": {
        "ownWorkDefault": "own",
        "ownWork": {
            "licenses": [
                "cc-by-sa-4.0"
            ]
        }
    },
    "fields": [
        {
            "wikitext": "Field test",
            "label": "Just testing the field"
        }
    ],
    "tutorial": {
        "skip": true
    }
}

Have descriptions actually been made optional everywhere? Spotting that it's marked as optional when I try an older campaign on non-beta Commons.

As a corollary: is it possible to hide the Description field while showing the Caption field instead?

Descriptions should always be required (sticking with long-held Commons policy). We're looking into why that may not be the case in some places currently.

Have descriptions actually been made optional everywhere? Spotting that it's marked as optional when I try an older campaign on non-beta Commons.

As a corollary: is it possible to hide the Description field while showing the Caption field instead?

Ok – I think I found why Description fields are being treated as optional. It actually doesn't have anything to do with Structured Data. UploadWizard as it is presently written is designed to treat description fields as optional if any additional wikitext field has been provided. Here's the relevant part of the code (starts at line 78 in resources/mw.UploadWizardDetails.js:

// descriptions
// Description is not required if a campaign provides alternative wikitext fields,
// which are assumed to function like a description
descriptionRequired = !(
	config.fields &&
	config.fields.length &&
	config.fields[ 0 ].wikitext
);

Descriptions should always be required (sticking with long-held Commons policy). We're looking into why that may not be the case in some places currently.

This is completely true, but for most campaigns the description is filled in a different way. See for example https://commons.wikimedia.org/wiki/File:Gendringen_Anholtseweg_78_01_(1).jpg part of https://commons.wikimedia.org/wiki/Campaign:wlm-nl , here the description is " |description={{Rijksmonument|523699}}" based on the configuration on https://commons.wikimedia.org/w/index.php?title=Campaign:wlm-nl&action=edit . Also asking for a manual description is redundant to asking for the id and we should be able to disable that.

As @Multichill mentioned above, this was an existing functionality that got a bit lost in the shuffle with the new SDC changes. We'll consider this "working as intended" and have our community relations people work on outreach/documentation to make it clear and try to avoid future confusion.