Page MenuHomePhabricator

[Task] Change Special:NewProperty to not have a datatype selected by default
Closed, ResolvedPublic

Description

It sometimes happens that people click create property too quickly without having thought about the datatype for the property. The property is then created with the datatype that is selected by default. We should not select a datatype by default and instead force the decision.

Event Timeline

The best way is to use checkboxes without default options to select the datatype in the property creation page.

It should be possible to change the property, at least as long as it is not used

If it's not yet used, this is technically not hard. If the property is in use, changing the data type can break existing data and introduce inconsistencies that render entire items unusable. In cases where the old and the new data type share the same internal format (they use the same value type), this is would not happen: changing between string and external-id and url would be possible, because the values can be re-interpreted without trouble. Changing e.g. from the time datatype to string would be impossible for existing data. That would Crash And Burn (tm).

Btw: We have a maintenance script for changing the data type of a property. This script will refuse to operate if the data types are not compatible (i.e. they don't use the same value type). We could perhaps allow it to operate on incompatible types if the property is unused.

Note: when detecting whether a property is unused, we cannot rely on the link tables in the database. They only tell us whether the property is used in a current revision. But old revisions, and even deleted items, must remain readable. That makes it extremely hard to determine whether a property is *actually* unused.

I should get some help in the create property-Step, since there are quite many types which are hard to grasp for a new user.

On wikidata, new users cannot create properties at all. This is reserved for admins. We should consider making it this way per default, for any new installation. Or at least strongly suggest it in the documentation.

One simple thing that could be done to elevate this issue is to not pre-select any data type on the property creation form. The default in the selector should be a message like "pick a data type" which would map to an empty value, which would be rejected when saving.

On wikidata, new users cannot create properties at all. This is reserved for admins. We should consider making it this way per default, for any new installation. Or at least strongly suggest it in the documentation.

OK, I did not know this (only tried on test and my local installation)

If it's not yet used, this is technically not hard.
[…] We could perhaps allow [a script] to operate on incompatible types if the property is unused.

Then I would leave it up the admins to decide if they need a way to revert the creation.

One simple thing that could be done to elevate this issue is to not pre-select any data type on the property creation form.

Yes, I suppose that would make sense in general.

We will not allow changing datatypes of existing properties beyond the existing maintenance script. It just causes way too much hassle. On Wikidata it is also restricted to a small group of people who know what they are doing with an extensive discussion period to determine among other things the datatype of a proposed property.
We can restrict the rights also for other installations by default.

@Lydia_Pintscher changing the form to not have a data type selected per default also make sense to me. As it is now, all you have to do is hit enter at the wrong time, and you have created a property with the wrong type.

I don’t know about the codebase to change for this one, but I assume it makes a good volunteer task, too, so I added the tag (Suggestion from @Lydia_Pintscher )

This shoud be a one-liner in SpecialNewProperty. It's probably not worth the pain for a volunteer to get up to speed with our code base.

Ok, a few more lines with internationalization:

In SpecialNewProperty::additionalFormElements, add an entry to the array returned by $selector->getOptionsArray(). That entry should have the key '' (empty string) and a value that is a translation of "(pick a data type)" taken from $this->msg( 'wikibase-newproperty-pick-data-type' ). The new key wikibase-newproperty-pick-data-type needs to be defined in i18n/en.json and i18n/qqq.json.

Lydia_Pintscher renamed this task from Easy to assign a wrong datatype to property; no way to change it to [Task] Change Special:NewProperty to not have a datatype selected by default.Aug 18 2016, 9:44 AM
Lydia_Pintscher removed Lydia_Pintscher as the assignee of this task.
Lydia_Pintscher updated the task description. (Show Details)
Lydia_Pintscher subscribed.

https://gerrit.wikimedia.org/r/349315 Add default value for datatype selector in SpecialNewProperty

@Micru once this task is done, yes.

I'm not sure that this will reduce the amount of errors.

Currently, the person who proposes the property sets the datatype. Afterwards, there are seven days where people can object to the proposal and the datatype that was selected. It takes at least one person to support the proposal the way it is. There's consensus for the datatype at the time it get's created.

This proposal is basically about making it easier to create properties that don't have the datatype on which there's community consensus. Sometimes this will mean that the property creator reflects about the property again and recognizes that the community consensus is bad. Other times this will mean that the creator doesn't correctly copy the agreed upon consensus.

What's your reasoning for believing that there will result in total in less errors? Especially given that it adds another manual action to the process.

@ChristianKl I don't see how this adds a manual step. The manual step was always there.

Old situation: A (essentially) random type is pre-selected in Special:NewProperty. The admin who creates the property has to check the selected type, and change it if appropriate. If they click "create" too soon (or accidentally hit enter), the property will be created with the wrong type.

New situation: No type is pre-selected. The admin who creates the property has to explicitly select a type. If they click "create" too soon (or accidentally hit enter), nothing happens.

I don't see how the old situation is better than the new one.

PS: IMHO, an admin should always think about what they are doing. Encouraging consideration is not a bad thing. If we don't trust admins to respect consensus, they should not be admins. But even if admins were prone to randomly ignore community consensus, the new behavior would still be better, since it avoids unintended actions.

thiemowmde moved this task from Review to Done on the Wikidata-Former-Sprint-Board board.

@ChristianKl, it appears your comment is misplaced, or lacks context. Are you referring to a specific on-wiki discussion? If so, can you please provide a link?

I don't fully understand the situations you are talking about. They sound like the community consensus changed after an administrator created the property. This is nothing we can solve by making changes to the Special:NewProperty form. We can change the property type in rare cases, but usually you need to delete a bad property and create a new one. This is by design. In the Wikibase world IDs should never be reused for something that is different.

Change 349315 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add default value for datatype selector in SpecialNewProperty

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

The standard way to create properties seems to be to click on "Create" in the property proposal. That automatically copies the description and the datatype.
It's supposed to also copy the property name and actually copies the name of the property proposal page into the name field (when the name isn't changed in the property proposal discussion that's usually the name that the property should have).

It might be that I misunderstood and you just change the behavior of SpecialNewProperty when that page is manually opened and not over the "Create" link?

When we talk about a "default" we mean the"string" preselection when you go to Special:NewProperty. The template you are referring to does not rely on any default but explicitly sets a type via a …?datatype=… URL parameter. This is unaffected and continues to work.

It might be that I misunderstood and you just change the behavior of SpecialNewProperty when that page is manually opened and not over the "Create" link?

Yes, this is just about the behavior of the page when invoked without any pre-selection.

@thiemo We should double-check that the pre-selection still works. I can't think of a reason why it wouldn't, but we should check.