Page MenuHomePhabricator

mediawiki_api Ruby gem incorrectly assumes path to index.php
Closed, DeclinedPublic

Description

Mediawiki Ruby gem has this for get_wikitext method:

def get_wikitext(title)
      @conn.get '/w/index.php', action: 'raw', title: title
end

On Mediawiki website itself /w/index.php gives either 404 or redirects to main page.

I reckon the directory should be configurable or just be a plain /index.php.

Event Timeline

Might be the cause but not an effect; it's making Ruby gem unusable as-is on some wikis. To make it work one would extend MWClient class — like this, perhaps:

require 'mediawiki_api'

class MWClient < MediawikiApi::Client
  def get_wikitext(title)
    @conn.get '/index.php', action: 'raw', title: title
  end
end

which might be not the best code when you're working with several wikis. There's no mention of it in the documentation AFAIK.

Thanks for the quick reply!

I guess I was not explicit enough. To fix the problem, I have to be able to reproduce it.

Can you point me to the code that fails because of this method, or provide a simple example?

Here's my example code: https://git.oreolek.ru/oreolek/mediawiki_mwe

The script should say 200, not 404.

zeljkofilipin triaged this task as Medium priority.
zeljkofilipin moved this task from Watching 📺 to Q4 👔 on the User-zeljkofilipin board.
zeljkofilipin lowered the priority of this task from Medium to Low.May 26 2017, 3:42 PM
zeljkofilipin renamed this task from Mediawiki Ruby gem incorrectly assumes path to index.php to mediawiki_api Ruby gem incorrectly assumes path to index.php.Jul 9 2019, 11:47 AM
zeljkofilipin lowered the priority of this task from Low to Lowest.

mediawiki_api Ruby gem was used by Selenium Ruby framework. Since the framework deprecated, I'm not sure if anybody ever will have the time to work on this. Should this be declined?

Similar to T102726.