Jump to content

Extension talk:Wikibase Repository

About this board

Wikibase items show wikitext after update

7
Till Kraemer (talkcontribs)

Hello, I recently upgraded to MediaWiki 1.37.0 and used the settings mentioned here. I'd like to continue using the main namespace for items, so my Wikibase.example.php looks like this:

// Alternative settings, using the main namespace for items.
// Note: if you do that, several core tests may fail. Parser tests for instance
// assume that the main namespace contains wikitext.
$baseNs = 120;

// NOTE: do *not* define WB_NS_ITEM and WB_NS_ITEM_TALK when using a core namespace for items!
define( 'WB_NS_PROPERTY', $baseNs +2 );
define( 'WB_NS_PROPERTY_TALK', $baseNs +3 );
define( 'WB_NS_QUERY', $baseNs +4 );
define( 'WB_NS_QUERY_TALK', $baseNs +5 );

// You can set up an alias for the main namespace, if you like.
//$wgNamespaceAliases['Item'] = NS_MAIN;
//$wgNamespaceAliases['Item_talk'] = NS_TALK;

// No extra namespace for items, using a core namespace for that.
$wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
$wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';
$wgExtraNamespaces[WB_NS_QUERY] = 'Query';
$wgExtraNamespaces[WB_NS_QUERY_TALK] = 'Query_talk';

// Tell Wikibase which namespace to use for which kind of entity
$wgWBRepoSettings['entitySources'] = [
	'local' => [
		'entityNamespaces' => [
			'item' => NS_MAIN, // <=== Use main namespace for items!!!
			'property' => WB_NS_PROPERTY, // use custom namespace
			'query' => WB_NS_QUERY, // use custom namespace
		],
		'repoDatabase' => $wgDBname,
		'baseUri' => $wgServer . '/wiki/',
		'rdfNodeNamespacePrefix' => 'wd',
		'rdfPredicateNamespacePrefix' => '',
		'interwikiPrefix' => '',
	],
];

I am able to create new items via Special:NewItem and I can edit them properly. However, all old items aren't editable and look like this:

{"type":"item","id":"Q1","labels":{"en":{
[...]

When I use Special:Export to export the new items, the XML file contains the following lines:

<model>wikibase-item</model>
<format>application/json</format>

The old items contain lines like these:

<model>wikitext</model>
<format>text/x-wiki</format>

The Page information of the old and new items show: Page content model: Wikibase Item. When I try to edit an old item via https://data.domain.com/wiki/Special:SetLabelDescriptionAliases/Q1/en, the following error shows up:

Internal error

[123456789] /wiki/Special:SetLabelDescriptionAliases/Q1/en TypeError: Argument 2 passed to Wikibase\Repo\Notifications\WikiPageActionEntityChangeFactory::newForPageModified() must be an instance of Wikibase\Repo\Content\EntityContent, instance of WikitextContent given, called in /path/to/data/w/extensions/Wikibase/repo/includes/Notifications/ChangeNotifier.php on line 149

Backtrace:

from /path/to/data/w/extensions/Wikibase/repo/includes/Notifications/WikiPageActionEntityChangeFactory.php(82)
#0 /path/to/data/w/extensions/Wikibase/repo/includes/Notifications/ChangeNotifier.php(149): Wikibase\Repo\Notifications\WikiPageActionEntityChangeFactory->newForPageModified()
#1 /path/to/data/w/extensions/Wikibase/repo/includes/RepoHooks.php(254): Wikibase\Repo\Notifications\ChangeNotifier->notifyOnPageModified()
#2 /path/to/data/w/includes/HookContainer/HookContainer.php(338): Wikibase\Repo\RepoHooks::onRevisionFromEditComplete()
#3 /path/to/data/w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#4 /path/to/data/w/includes/HookContainer/HookRunner.php(3191): MediaWiki\HookContainer\HookContainer->run()
#5 /path/to/data/w/includes/Storage/PageUpdater.php(1255): MediaWiki\HookContainer\HookRunner->onRevisionFromEditComplete()
#6 /path/to/data/w/includes/Storage/PageUpdater.php(833): MediaWiki\Storage\PageUpdater->doModify()
#7 /path/to/data/w/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(403): MediaWiki\Storage\PageUpdater->saveRevision()
#8 /path/to/data/w/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(262): Wikibase\Repo\Store\Sql\WikiPageEntityStore->saveEntityContent()
#9 /path/to/data/w/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityStore.php(85): Wikibase\Repo\Store\Sql\WikiPageEntityStore->saveEntity()
#10 /path/to/data/w/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEntityStore.php(53): Wikibase\Lib\Store\TypeDispatchingEntityStore->saveEntity()
#11 /path/to/data/w/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(735): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore->saveEntity()
#12 /path/to/data/w/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(77): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave()
#13 /path/to/data/w/extensions/Wikibase/repo/includes/Specials/SpecialWikibaseRepoPage.php(194): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave()
#14 /path/to/data/w/extensions/Wikibase/repo/includes/Specials/SpecialModifyEntity.php(219): Wikibase\Repo\Specials\SpecialWikibaseRepoPage->saveEntity()
#15 /path/to/data/w/includes/specialpage/SpecialPage.php(647): Wikibase\Repo\Specials\SpecialModifyEntity->execute()
#16 /path/to/data/w/includes/specialpage/SpecialPageFactory.php(1366): SpecialPage->run()
#17 /path/to/data/w/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#18 /path/to/data/w/includes/MediaWiki.php(925): MediaWiki->performRequest()
#19 /path/to/data/w/includes/MediaWiki.php(559): MediaWiki->main()
#20 /path/to/data/w/index.php(53): MediaWiki->run()
#21 /path/to/data/w/index.php(46): wfIndexMain()
#22 {main}

Any help is more than appreciated!

Thanks and cheers,

Till

Till Kraemer (talkcontribs)

I just exported an old item via Special:Export and changed <model>wikitext</model> to <model>wikibase-item</model> and <format>text/x-wiki</format> to <format>application/json</format> in Notepad++. When I try to import the XML file with Special:Import, I get the following message: "Revision 1 using content model wikitext cannot be stored on "Q1" on this wiki, since that model is not supported on that page." This is pretty similar to the message I get when I try to use Special:ChangeContentModel: "No content models available: The content on Item (Q1) cannot be converted to any type."

I temporarily set $wgWBRepoSettings['allowEntityImport'] = true; in LocalSettings.php and imported the XML file with importDump.php. The script ran without any error but the content model didn't change.

I also tried to add $wgWBRepoSettings['entityNamespaces']['CONTENT_MODEL_WIKIBASE_ITEM'] = NS_MAIN; and even $wgNamespaceContentModels[NS_MAIN] = 'CONTENT_MODEL_WIKIBASE_ITEM'; to LocalSettings.php but that didn't solve the problem either.

I don't really understand why the old items and the new items are in the same namespace and still behave differently. @Thiemo Kreuz (WMDE), do you have any idea what could be at play here?

Thanks and cheers,

Till

Lwangaman (talkcontribs)

just a thought... isn't entitySources supposed to be defined on the $wgWbClientSettings array? Looking at the configuration page it seems to be a client setting, not a repo setting?

Lwangaman (talkcontribs)

actually let me correct that... the configuration page doesn't explain very much. Reading the full documentation, I see it is both a client and a repo configuration...

Till Kraemer (talkcontribs)

@Lwangaman, Thank you for the reply! I guess I just have to keep on trying. Maybe one day a new version will be released that fixes my issues :) Cheers and all the best!

Till Kraemer (talkcontribs)

The only way I found to fix this is to create a new item, delete the old item, redirect the old item to the new item, and delete the redirect. With thousands of items, this is a lot of work though. Anyway, it's still a solution. Thanks, cheers and all the best!

Till Kraemer (talkcontribs)
Reply to "Wikibase items show wikitext after update"

How to get values for Wikibase datatype 'Tabular data' from local wiki rather than from commons.wikimedia.org?

1
MW Kappa (talkcontribs)

We are wondering whether it is possible to configure Wikibase and/or JsonConfig for using the local wiki as a source of the values for Wikibase properties with type 'tabular data'. Our current configuration is

$wgJsonConfigModels['JsonConfig.TabularContent.local'] = 'JsonConfig\JCTabularContent';
$wgJsonConfigs['JsonConfig.TabularContent.local'] = array(
        'namespace' => 486,     
        'nsName' => 'Data', 
        // pattern for page name
        'pattern' => '/^[A-Z]*[a-z]*\.tab$/',
        'isLocal' => true,
);

but this does not work as desired. Wikibase still searches for *.tab pages in commons.mediawiki.org rather than in the local wiki.

Reply to "How to get values for Wikibase datatype 'Tabular data' from local wiki rather than from commons.wikimedia.org?"

wikibase 1.39 with SemanticMediawiki 4.1.1 errors

2
84.254.82.147 (talkcontribs)

Tried and installed both extensions. They work individually but not together.

The error is;

/mediawiki/index.php/Special:NewProperty MediaWiki\Page\PageAssertionException: The given PageIdentity Special:Badtitle/NS122:NewProperty does not represent a proper page

#0/mediawiki/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditFilterHookRunner.php(142): MediaWiki\Page\WikiPageFactory->newFromTitle()

....

Any advice?

MW Kappa (talkcontribs)

We observed a namespace name conflict between Semantic MediaWiki and Wikibase. Both are using a namespace with the canonical name 'Property'. We renamed the Semantic MediaWiki namespace and successfully use both extensions in the same wiki.

$IP/LocalSettings.php:

# the namespace names must bechanged before SMW is activated
$wgExtraNamespaces[102] = "SemanticProperty";
$wgExtraNamespaces[103] = "SemanticProperty_talk";
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'localhost' );

$IP/extensions/SemanticMediaWiki/src/NamespaceManager.php:

public static function getCanonicalNames() {
		$canonicalNames = [
			SMW_NS_PROPERTY      => 'SemanticProperty',
			SMW_NS_PROPERTY_TALK => 'SemanticProperty_talk',
            ...
		];
		return $canonicalNames;

Tested with MW 1.35 and SMW 4.0.2

Reply to "wikibase 1.39 with SemanticMediawiki 4.1.1 errors"

Cannot Edit/Add statements to an Item

21
E.Kuijt (talkcontribs)

Hi All, After running the wikibase/installation steps everything seemed to work just right. I can make Items and properties and these are added to my wiki.

But when I go to my new generated Item page, the +Add behind statements is missing.

In my inspect console i get this traceback.

Exception in module-execute in module wikibase.experts.getStore:

load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:176 TypeError: Cannot set property 'getStore' of undefined TypeError: Cannot set property 'getStore' of undefined

    at load.php?debug=false&lang=en&modules=jquery.tipsy|jquery.wikibase.edittoolbar%2Csitelinkview%2Csnakview%2Ctoolbaritem%2Cwbtooltip|oojs-ui-core%2Coojs-ui-widgets|oojs-ui-core.styles|oojs-ui.styles.icons|wikibase.experts.getStore|wikibase.ui.entityViewInit&skin=vector&version=1dx8mfw:283

    at load.php?debug=false&lang=en&modules=jquery.tipsy|jquery.wikibase.edittoolbar%2Csitelinkview%2Csnakview%2Ctoolbaritem%2Cwbtooltip|oojs-ui-core%2Coojs-ui-widgets|oojs-ui-core.styles|oojs-ui.styles.icons|wikibase.experts.getStore|wikibase.ui.entityViewInit&skin=vector&version=1dx8mfw:284

    at Object.<anonymous> (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:161)

    at fire (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:45)

    at Object.add [as done] (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:45)

    at Object.always (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:46)

    at runScript (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:160)

    at checkCssHandles (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:161)

    at execute (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:162)

    at Object.implement (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=04kt0mo:168)

Can anyone help me with this? Thx

Eric

Thiemo Kreuz (WMDE) (talkcontribs)
E.Kuijt (talkcontribs)

Thx for your swift reply, I changed the line and I'm afraid it didn't work for my case.

The Errormessage now changed to: Error: Module "wikibase.experts.modules" is not loaded. Error: Module "wikibase.experts.modules" is not loaded.

Thiemo Kreuz (WMDE) (talkcontribs)

Uh. That sounds like you had a typo somewhere. Can you double-check?

E.Kuijt (talkcontribs)

Yep, was a typo, error message gone now. Unfortunately this didn't add the +Add at the Statements button.

Do I have to configure something else for that?

Thiemo Kreuz (WMDE) (talkcontribs)

No special configuration needed. If the buttons don't appear, but you do not get an error message on the JavaScript console any more, then something a bit more awkward is broken. Hard to track down from the distance. Maybe you can check what Special:Version lists and paste the relevant parts, namely the Wikibase Repository and the DataTypes lines?

E.Kuijt (talkcontribs)
Wikibase Client 0.5 alpha (35343ae)12:49, 14 September 2017 GPL-2.0+ Client for the Wikibase extension The Wikidata team and others
Wikibase DataModel JavaScript 3.1.0 GPL-2.0+ Javascript implementation of the Wikibase data model H. Snater
Wikibase JavaScript API 2.2.2 GPL-2.0+ Wikibase API client in JavaScript H. Snater
Wikibase Repository 0.5 alpha (35343ae)12:49, 14 September 2017 GPL-2.0+ Structured data repository The Wikidata team and others
Wikibase Serialization JavaScript 2.1.0 GPL-2.0+ JavaScript library containing serializers and deserializers for the Wikibase DataModel. H. Snater
Wikibase View 0.1-dev GPL-2.0+ Wikibase View H. Snater
WikibaseLib 0.5 alpha (35343ae)12:49, 14 September 2017 GPL-2.0+ Holds common functionality for the Wikibase and Wikibase Client extensions The Wikidata team and others

Maybe it would be wise to select a version branch?

Thiemo Kreuz (WMDE) (talkcontribs)

Sure, that would be wise, and we are working on it. What you pasted above looks right. Sorry, I do not have an other idea at the moment.

2A01:CB05:8097:8E00:9D95:28BD:BB6A:B123 (talkcontribs)

Hi,

I am having the same issue, i have the same Special:Version information for the wikibase extension. I also tried with the REL1_27 (REL1_29 and REL1_28 are broken it seems) and i do have the +add button but the "save" button to submit the form stays gray and not clickable.

Is there any older version of MediaWiki + Wikibase that work? I would like to have it up and running no matter which version.

Thank you very much in advance,

Sean.

Thiemo Kreuz (WMDE) (talkcontribs)

As Wikibase/Installation states you should use the master branches of both MediaWiki and Wikibase. Older releases are not necessarily compatible to each other.

2A01:CB05:8097:8E00:38B8:93B7:A8A1:8773 (talkcontribs)

Hi,

Thank you for your promt answer. I started working with the master version and given that i have data to transform and import as wikibase items i'm starting to play with the api. I added statements to an item hoping that the "edit" and "add value" button would be there but they arn't.

The good news is that it seems that everything is working propely server side and the statements are being displayed on the browser, but not editable. Should i check something about the rights of my user account?

Thanks,

Sean.

Thiemo Kreuz (WMDE) (talkcontribs)

Editing is allowed for everybody by default. So no, I don't thing this has something to do with user rights.

Jtuom (talkcontribs)

Hello.

I'd like to reactivate this question, because we installed Wikibase in early December 2017 and experience the same problem: Add button for adding statements does not exist. I checked the resources.php file mentioned in the discussion above, and it does already have the corrected line of code. Any new thoughts about what could be going on? I am not really computer savvy so unfortunately I cannot run any diagnostics without detailed instuctions.

Thanks.

Jouni

Thiemo Kreuz (WMDE) (talkcontribs)

Without knowing anything about your setup the only thing I can say is that you might check your local Special:Version. Make sure the Wikibase version you installed is compatible to your MediaWiki version. This is explained in more detail on Wikibase/Installation.

Tinker Bell (talkcontribs)

Hi, I've installed MediaWiki 1.31.1, and I have the same problem: the add button for adding statements doesn't show. I've followed the steps in Wikibase/Installation twice, I downloaded the branch branch REL1_31, and checked the change in resources.php, I don't know what other thing could cause the problem. Thanks.

In my Special:Version:

  • Wikibase Client: – (8178d16) 15:25 17 abr 2018
  • Wikibase Repository: – (8178d16) 15:25 17 abr 2018
  • Wikibase View: – (8178d16) 15:25 17 abr 2018
  • WikibaseLib: – (8178d16) 15:25 17 abr 2018
141.142.60.85 (talkcontribs)

Same issue for me here. Any help is greatly appreaciated

Skmp (talkcontribs)

I had the same problem and I think I found a solution. The problem was that if you download a specific version from github *without* using a command "git clone ..." but instead downloading it using "Download ZIP" button, you won't get the submodules you need. The solution is to download it using a git command like so: git clone --recursive --single-branch --branch REL1_31 https://github.com/wikimedia/mediawiki-extensions-Wikibase.git. Note the recursive key.

Thomas-topway-it (talkcontribs)

Hello, we have the same issue,

installing mediawiki REL1_34

and wikibase REL1_34

using

git clone --recursive https://gerrit.wikimedia.org/r/mediawiki/core.git --branch REL1_34 mediawiki

and

composer require wikibase/wikibase:dev-REL1_34

after install  the link "add statement" does not show

and we get the following error

mediawiki/includes/resourceloader/ResourceLoaderFileModule.php: ResourceLoaderFileModule::readScriptFiles: script file not found: ".../mediawiki/extensions/Wikibase/view/lib/wikibase-data-values/src/dataValues.js"


how can we solve that on that wikimedia / wikibase version ?

thanks

(Thomas)

PeaceDeadC (talkcontribs)

setting zlib.output_compression = Off in php.ini solved the issue in my case.

134.76.2.127 (talkcontribs)

Also doesn't work in my 1.37 version.

Neither recursive cloning nor turning zlib.compression off worked for me.

134.76.2.127 (talkcontribs)

Alright, I fixed it. Running

cd Wikibase

git submodule update --init --recursive

and then doing composer --no-dev and all php scripts again did it.

Reply to "Cannot Edit/Add statements to an Item"

getGlobalSiteID nill value

2
Foreclosurepedia (talkcontribs)

MW 1.34.2: "Lua error in Module:Wd at line 196: attempt to call field 'getGlobalSiteId' (a nil value)." Prolific error on each and every WP Template:Infobox company layout and across the internet. Here is an example on my site: https://digitalmatrixgroup.com/index.php/Caliber_Home_Loans

Been in and out of IRC and have not found a solution. Any help appreciated!

Foreclosurepedia (talkcontribs)

I realize this is a Lua error; however, Wikibase cited as potential issue here: https://en.wikipedia.org/wiki/Module_talk:Wd

I attempted to upgrade to Wikibase 1.35 and got 500 Server error. Not sure if the upgrade would even help and if so, do I then need to upgrade everything including the MW Core?

Thanks

Reply to "getGlobalSiteID nill value"

mediawiki and wikidata

9
Abdulaziz Alwafaee (talkcontribs)

I have mediawiki installed, and wikibase installed as well,

The question here, How can i access wikibase? to confirm that its working or functioning.

Thiemo Kreuz (WMDE) (talkcontribs)

I think you want to check your own Special:SpecialPages and see if it lists the special pages to create properties as well as items. These should be in a "Wikibase" section at the bottom of the page. It might be that you can't access Special:NewProperty if you are not an administrator. However, it should be possible to create your first item without having any properties.

Abdulaziz Alwafaee (talkcontribs)

i have it and i can access Special:NewProperty, but its being active on pages.


for each and every page here or on wikipedia, you will get a link named Wikidata item, i can't find this link

Thiemo Kreuz (WMDE) (talkcontribs)
Abdulaziz Alwafaee (talkcontribs)

i only have one wiki, and i dont wont to link to a different wiki, i only want o show wikidata inside page information, is it possible for single wiki

Thiemo Kreuz (WMDE) (talkcontribs)

What do you want to achieve?

There is not much value in linking pages (e.g. in the main namespace) to items (e.g. in an Item: namespace) on the same wiki. You can try doing this by setting up Repo and Client the same time. But the as far as I know only advantage you have is that you can use certain functions in the main namespace (e.g. {{#statements:…}}) without naming the Q-ID of the item.

Abdulaziz Alwafaee (talkcontribs)

I only wanted to maintain values of templates, for instance, the template that gets information of Wayback machine here at this link;

https://en.wikipedia.org/wiki/Wayback_Machine

All the required information are being directly fetched from wikibase, while at the same time i can't fetch it on my wiki.

You looks more experienced than I do, you might be able to help me form my question in a better way.


Thank you for being active here

Thiemo Kreuz (WMDE) (talkcontribs)

Do you want to create your own data repository, or do you want to reuse data from wikidata.org? The later is not yet possible.

Abdulaziz Alwafaee (talkcontribs)

reusing data from wikidata is not possible, and i do understand this, but how to create my own data, i have no idea, I've installed everything, and all are working with no errors, but i only miss something to do which i dont know what.

if you want i can share access with you,

Reply to "mediawiki and wikidata"

Search box doesn't work properly since Wikibase is installed

1
Cccefalon (talkcontribs)

The autocompletion in the Search Box doesn't work properly, since I installed Wikibase. No matter what I type, it displays a spinning wheel and then returns "No match was found".

The Advanced Search is working correctly and throws out autocompletion proposals as before.

WikiBase is running smooth, too.

Reply to "Search box doesn't work properly since Wikibase is installed"

Document special pages?

7
197.235.65.167 (talkcontribs)

It appears that special pages introduced by this extension aren't documented at all, e.g. stuff like Special:GoToLinkedPage , and others. This is in contrast to most other extensions such as Extension:CentralAuth , Extension:Linter. That special page wasn't documented even on wikidata.org.

197.235.65.167 (talkcontribs)
Thiemo Kreuz (WMDE) (talkcontribs)

What exact kind of "documentation" do you have in mind?

197.235.55.43 (talkcontribs)

At this point any documentation would be better than the status quo. There was zero documentation on gotolinkedpage, until recently added to a FAQ on wikidata. It was not even clear where to add such documentation considering that not a single page on mediawiki.org seems to have a mention of wikibase special pages.

So basically, any documentation on the purpose and usage instructions. While most of those are only relevant to wikidata others are relevant elsewhere :

The word "entity" might be understood by wikidata editors, and software engineers, but it is jargon, and the special page above doesn't have a single link to an explanatory note.

Side note: It appears that several people have asked for existing functionality exactly because it isn't documented, e.g.: https://phabricator.wikimedia.org/T176317, https://phabricator.wikimedia.org/T202299and probably others.

Thiemo Kreuz (WMDE) (talkcontribs)

Thanks for bringing this up. However, I'm afraid I can't really tell what the question or suggestion is. Special pages typically don't exist in isolation, but make sense in a particular context, for particular use cases. The first line on each special page should explain what it is for, and ideally provide a link either in the text or via the question mark icon in the top right corner. If this is missing, please feel free to suggest improvements, ideally as a Phabricator ticket or on the talk page of d:Wikidata:WikiProject Documentation.

197.235.77.164 (talkcontribs)

The suggestion is simply to add some basic documentation on wiki about it. The simplest case would be a simple listing of the special pages along with a brief description of what they do, e.g.:

Page Description
Special:One The one ...
197.235.77.164 (talkcontribs)

Pages like https://www.wikidata.org/wiki/Special:AvailableBadges, and https://www.wikidata.org/wiki/Special:RedirectEntitydon't have much description even in the special pages themselves. So context is definitely missing there.

It seems that some extensions have a mention of special pages in Module:Extensionjson all that would be needed would be a simple description of each. Long term, it would probably make more sense to have a parserfunction that pulls this information from the extensions, that way it would never get out of sync with the deployed code...

Anyway, thanks for the links.

Reply to "Document special pages?"
Till Kraemer (talkcontribs)

Hi, thank you for an awesome extension, I love it! :) One question though: when I create a property "image" with data type "Commons media file", I can only select files from Commons in the statements section. I'd like to use images from my own pool exclusively and I'd like to rename "Commons media file" to "Pool media file". How can I achieve this?

My Wikibase.example.php looks like this:

# $wgWBRepoSettings['specialSiteLinkGroups'] = array( 'commons', 'wikidata' );
$wgWBRepoSettings['specialSiteLinkGroups'] = array( 'pool', 'data' );

The "sites" table on the datawiki database has this row (among others):

| 123 | poolwiki | mediawiki | pool | local | en | https | moc.niamod.loop.  | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:28:"https://pool.domain.com/w/$1";s:9:"page_path";s:31:"https://pool.domain.com/wiki/$1";}} | 0 | a:0:{} |

And the "sites" table of the poolwiki database has this entry (among others):

| 124 | datawiki | mediawiki | data| local | en | https | moc.niamod.atad. | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:28:"https://data.domain.com/w/$1";s:9:"page_path";s:31:"https://data.domain.com/wiki/$1";}} | 0 | a:0:{} |

LocalSettings.php of datawiki has this line:

$wgWBRepoSettings['localClientDatabases'] = array( 'dewiki', 'enwiki', poolwiki' );

What am I missing here? Any help is more than welcome! Thanks and cheers!

Lydia Pintscher (WMDE) (talkcontribs)

Hey :) It is currently not possible unfortunately. We have an open issue for it at phabricator:T90492.

Till Kraemer (talkcontribs)

Hi @Lydia Pintscher (WMDE), thanks for your help! Sorry, I didn't know that there is already a discussion about it going on.

I changed //commons.wikimedia.org/wiki/File: to https://pool.domain.com/wiki/File: in Wikidata/extensions/Wikibase/lib/includes/Formatters/CommonsLinkFormatter.php and https://commons.wikimedia.org/w/api.php to https://pool.domain.com/w/api.php in Wikidata/extensions/ValueView/lib/jquery.ui/jquery.ui.commonssuggester.js.

Now the files of my pool show up in the statements section, but when I try to save them, I'm getting the following error: "The file "Lalala123.jpg" does not exist on Wikimedia Commons." I also set $commonsWikiId = 'poolwiki'; in Wikidata/extensions/Constraints/includes/ConstraintCheck/Checker/CommonsLinkChecker.php, but it still doesn't work.

Do you know what other file(s) I have to edit or do I just have to clear some cache? Or do you mean by "not possible" it actually is not possible? :)

Daniel Kinzler (WMDE) (talkcontribs)

Hi Till! You need to also change the URL hardcoded in wikidata/extensions/Wikibase/repo/includes/CachingCommonsMediaFileNameLookup.php

Till Kraemer (talkcontribs)

Hi @Daniel Kinzler (WMDE), thanks for your help! Sorry, you're right, I totally missed that one. And I found another file with a hardcoded URL in it: Wikidata/extensions/Wikibase/repo/includes/WikibaseRepo.php. I changed that file too, but I'm still getting the error mentioned above. I'll keep digging :) Cheers!

Codeispoetry (talkcontribs)

Maybe the existence-check for the validation is done directly through the database?

Till Kraemer (talkcontribs)

Hi @Codeispoetry, thanks for your suggestion! I've found commonsMedia in wb_property_info and some stuff in l10n_cache but no URL :/ Cheers!

Till Kraemer (talkcontribs)

Hi, I'm trying to create a list of files which need to be changed in order to use own images on the repo. I changed the following files (MediaWiki 1.31):

  • Wikibase/view/lib\wikibase-data-values-value-view/lib/jquery.ui/jquery.ui.commonssuggester.js (line 181)
  • Wikibase/lib/includes/Formatters/CommonsLinkFormatter.php (line 62)
  • Wikibase/repo/includes/CachingCommonsMediaFileNameLookup.php (line 66)
  • Wikibase/repo/includes/Rdf/RdfVocabulary.php (lines 57 and 59)
  • Wikibase/view/lib/wikibase-data-values-value-view/src/jquery.valueview.valueview.js (line 195)
  • Wikibase/view/lib/wikibase-data-values-value-view/src/experts\CommonsMediaType.js (line 30)
  • Wikibase/repo/i18n/* (around line 87 to 175, depending on the language [search for "wikibase-validator-no-such-media"])
  • Wikibase/lib/i18n/* (around line 19 to 109, depending on the language [search for "datatypes-type-commonsMedia"])
  • Wikibase/client/config/WikibaseClient.default.php (lines 241 and 246, probably not related though and probably should be changed via LocalSettings.php, see Wikibase/docs/options.wiki)
  • Wikibase/repo/config/Wikibase.default.php (lines 216, 221, 224 and 229)

It's still not working :/ The file names and thumbs show up in the statements section, but when I try to save an image, the old error appears: "Could not save due to an error. The file "Lalala123.jpg" does not exist on MyWiki Pool."

Do I need to change the files in the Wikibase tests folders too? Do I need to change the database name from commonswiki to mypoolwiki somewhere?

Any ideas are more than welcome! Thanks and cheers!

Reply to "Using own images"

Call to undefined method Revision::getRevisionRecord()

3
Skmp (talkcontribs)

For some reason, I get this error when I'm trying to create a new item through Special:NewItem. I searched this error in Google and found nothing. What am I downg wrong? ;(

I use:

MediaWiki 1.30.0

PHP 7.1.11 (apache2handler)

Wikibase Repository cc48ad1 (downloaded usign git)

I was following this instruction — Wikibase/Installation

Please help.

error log

Thiemo Kreuz (WMDE) (talkcontribs)

It looks like the MediaWiki version you are using does not match the Wikibase version. The branch you are pointing to is from yesterday, while MediaWiki 1.30 is from December. The red box on Wikibase/Installation mentions this. You probably want to download Wikibase's REL1_30 branch.

Skmp (talkcontribs)

It works, thanks a lot!