Wikidata:How to create Wikidata Tours/Troubleshoot

From Wikidata
Jump to navigation Jump to search

Troubleshooting

This section explains how to identify and fix common problems with Wikidata Tours. If you experience a problem that is not on the list, please post a comment on the Discussion page to indicate that it should be included in this list.

Whenever a tour will not load, first try loading it with the debug=true parameter added to the tour URL, this will provide extra information in the browser console that will help you to identify the problem. For example, the Items Tour can be debugged using the URL https://www.wikidata.org/w/index.php?title=Q16943273&tour=wbitems&debug=true.

Note: When in debug mode, the tour will take a very long time to load, it can take up to 2 minutes!

Tour does not load

  1. Does the Wikidata item and tour name used in the tour URL exactly match the values specified in the tour JavaScript file? If these do not match, the tour won't load.
  2. Does the Wikidata item specified exist? If you have migrated from main to test Wikidata or vice versa, you may have a tour item specified that does not exist on that wiki.
  3. Is the Wiki Page location added correctly to the JavaScript file? This is set as part of the initialisation options, and is required to load any content for the tour steps.
  4. Is the label + description being added in the startup data unique on Wikidata? If the startup data uses a label/description combination that already exists, the initial edit to the tour item is rejected and tour will not load.
  5. Does the name of the tour include any special characters, spaces or hyphens? You will need to remove these if so, and set the new name in your JavaScript file.
  6. Is the JavaScript filename and location is exactly right? It must be placed in the MediaWiki namespace using the exact start to the filename specified in the instructions above.

Startup data not being added to the item

  1. Is the syntax of the newData object in the JavaScript file correct? If there are any errors non of the data will be added to the item.
  2. Do all the properties in the startup data have the correct data type? If this is incorrect for any of the statements being added, then no startup data will be added. For example, attempting to add the statement coordinate location (P625)human (Q5) will result in no data being added.

Tour item not being cleared of data when the tour starts

  1. Does the tour URL you are using have &data=ok at the end? If so, remove this from the URL and the tour will clear the item data correctly on startup. The data=ok parameter is added by the Guided Tour library to indicate that the tour item has been cleared and startup data added, so if you add this yourself it will not complete this startup step.