Jump to: navigation, search

About this board

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL (talkcontribs)
  • Construct an ApiMain object with the arguments passed via the URL and call its execute() method to do the actual API stuff.
Thiemo Mättig (WMDE) (talkcontribs)

I'm afraid this question is way to generic. I can see it's a quote from Manual:Api.php. But the relevant question is, what do you want to do? What do you have and what do you want to achieve? Maybe it helps if you start playing around with the d:Special:ApiSandbox?

Reply to "how to do this step"

API token... documentation error?

Summary by Thiemo Mättig (WMDE)

Editing via API must be done via POST, and can not be done via JSONP.

Valerio Bozzolan (talkcontribs)

Going here I see the «token» param. But trying to use it, it throws an error:

"code": "mustpostparams"
"info": "The following parameter was found in the query string, but must be in the POST body: token."

How to use it? Thanks.

Valerio Bozzolan (talkcontribs)

Solved. Means POST method. Yes, I used POST method, but I was under same origin policy restrictions, and it does not work with JSONP. Abandoned.

Bttfvgo (talkcontribs)

I installed Wikibase which solved a lot of the problems on my MediaWiki site. Now, however, search suggest is no longer working. Results normally popped up as letters were typed into the search bar but now the only thing that pops up is a spinning wheel and nothing being found (it only shows the current typed text, italicized). Any help on getting Search working again is much appreciated! Thank you!

Thiemo Mättig (WMDE) (talkcontribs)

If you turn your local wiki into a Wikibase repository, the search box in the upper right will be replaced with an entity search. There is currently no way to turn this of. You can hack the code and remove the line $out->addModules( 'wikibase.ui.entitysearch' ); in the file repo/Wikibase.hooks.php just to see if it works.

Bttfvgo (talkcontribs)

I have been playing around with various things but to no avail. Removing the line you listed removes the spinning wheel that searches for "items" rather than pages. I had made a sample item once and the search box showed that one with no problem. I have been playing with different variables in LocalSettings.php, such as $wgUseAjax, $wgEnableOpenSearchSuggest, $wgVectorUseSimpleSearch and $wgEnableMWSuggest and can get them to show, but only once (if you use them they don't appear at all after that) but they appear in a results list which appear atop the "other" results list. Going to the search page itself which bring up suggested results with no problem. Any ideas?

Thiemo Mättig (WMDE) (talkcontribs)

I don't understand what you want to do. I assume you want the top-right search box to suggest both items (by their label) as well as page names in other namespaces. Such a feature does not exist.

Bttfvgo (talkcontribs)

That is indeed what I want. The search box on the Special:Search page does indeed search for suggested results when letters are typed (but doesn't search for entities). Is there a way to swap the primary search box (which got replaced with entity search) with the one used on the Special:Search page? Search suggest works there! Or is there any extension I can get? I know MediaWiki and Wikipedia both use CirrusSearch but I cannot complete installation because my current hosting plan doesn't offer Java and apparently you need Java to get Elasticsearch to work. Is there a workaround or possibly another extension, or can I just change the primary box with the one on Special:Search? Thanks again!

Bttfvgo (talkcontribs)

Is there perhaps something I can edit in the file /extensions/Wikibase/repo/resources/wikibase.ui.entitysearch.js? I've found two lines: Updates the suggestion list special item that triggers a full-text search. and Removes the native search box suggestion list. Can I edit anything on the page to change it back? I feel like I'm so close! Thanks!

Bttfvgo (talkcontribs)

I put it back but removing the lines

		function removeSuggestionContext( input ) {
			var context = $.data( input, 'suggestionsContext' );

			if ( context ) {
				// Native fetch() updates/re-sets the data attribute with the suggestion context.
				context.config.fetch = function() {};
				$.removeData( input, 'suggestionsContext' );

does indeed add search suggestion capabilities back the box. However, the "other" search list still appears under this one. I can try removing the lines below the aforementioned section of code, which look like they would add the spinner and entity search features. I really do hope there's a way! Suggested search is so, so nice.

Bttfvgo (talkcontribs)

Okay, so I removed the above, and all lines below it, up to // Default form submit action: Imitate full-text search. I went ahead and ran $php maintenance/update.php and everything seems to be working great again. I haven't ran into any inherent problems, and that "other" search box doesn't appear anymore. Only search suggestions, same as it always has. I hope there won't be any problems caused by doing that. Granted I won't be able to search for "items" anymore, but it's okay, I don't have any anyway. I merely added the feature for "future expansion". If you know of any possible problems that will come from having eliminated that code, please let me know!!

Reply to "Search no longer works properly"
Nemo bis (talkcontribs)

There are no links to the user manual, where is it? On Meta?

Nemo bis (talkcontribs)

Unless I'm blind and all links on this wiki and Meta are wrong, it seems there is no user manual.

What I was looking for was Wikibase/DataModel#Dates_and_times, approximately (bugzilla:64593). It took me 25 minutes to find that page/section and from the warning at the top of the page it seems to be an implementation plan, not documentation. I think this extension really needs to have a user manual, which would typically be in Help namespace here on

If most of the planned stuff has been implemented, you could rephrase most of the pages and then mark the various sections with version markers as we do for the rest of MediaWiki, also tagging stuff left to future releases.

Reply to "User manual"
There are no older topics