Last modified: 2014-02-12 23:45:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60321, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58321 - $wgMobileUrlTemplate ignored if does not start with a placeholder
$wgMobileUrlTemplate ignored if does not start with a placeholder
Status: RESOLVED WORKSFORME
Product: MobileFrontend
Classification: Unclassified
Feature requests (Other open bugs)
unspecified
All All
: Unprioritized enhancement
: ---
Assigned To: Nobody - You can work on this!
http://www.google-melange.com/gci/tas...
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-11 10:01 UTC by Niccolo Rigacci
Modified: 2014-02-12 23:45 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Niccolo Rigacci 2013-12-11 10:01:36 UTC
I installed MediaWiki 1.21.3 with MobileFrontend 30dad7e on a Debian Wheezy.

If I set the $wgMobileUrlTemplate variable to a fixed constant, like this:

$wgMobileUrlTemplate = 'www.m.mydomain.org';

it is not used at all to compose the "Mobile view" link at the bottom of the page. The standard domain 'www.mydomain.org' is used instead.

If the variable contains a placeholder at the begin, the "Mobile view" link is correct:

$wgMobileUrlTemplate = '%h0.m.%h1.%h2';
Comment 1 Bingle 2013-12-11 10:25:29 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://wikimedia.mingle.thoughtworks.com/projects/mobile/cards/1498
Comment 2 Arthur Richards 2013-12-11 19:20:12 UTC
Niccolo, when the functionality for the alternate mobile domain was initially written, it supported a static mobile domain (rather than the template). As the codebase evolved, it appears this functionality disappeared - likely as an oversight. I took a quick look over the host-handling code and I *think* it should be a quick fix, however this is fairly low priority relative to many of the other bugs/new feature work we currently have lined up.

This could be a great bug for a volunteer to pick up. The places to look in the code for resolving this are in includes/MobileContext.php - MobileContext::getMobileUrl() and MobileContext::updateMobileUrlHost(). The related PHPUnit tests will also need an update.
Comment 3 Jon 2013-12-27 07:45:31 UTC
Quim - you know the drill - google code in could work here :D
Comment 4 Quim Gil 2013-12-28 18:25:33 UTC
Done. Thank you!
Comment 5 Mateusz Maćkowski 2013-12-29 11:21:22 UTC
MediaWiki 1.21.3 (54f7112)
MobileFrontend 0.7.0 (30dad7e)

LocalSettings.php:
require_once("extensions/MobileFrontend/MobileFrontend.php");
$wgMFAutodetectMobileView = true;
$wgMobileUrlTemplate = 'www.m.mydomain.org';

The generated link is: "http://www.m.mydomain.org/[rest of the URL here]"

Am I doing something wrong here? It's looking like there's no bug at all...
Comment 6 Max Semenik 2013-12-30 20:18:50 UTC
Same for me, seems to be working.
Comment 7 Quim Gil 2013-12-30 20:22:23 UTC
GCI task deleted...

Thank you Mateusz for the verification, and sorry for the extra work spent. This is another type of lesson to be learned about things that may happen in any free software project...
Comment 8 Jon 2013-12-30 20:28:04 UTC
Although no patch was needed reviewing the bug was obviously needed - so thanks Mateusz for verifying this is no longer a problem! :)
Comment 9 Quim Gil 2013-12-30 20:28:24 UTC
On a second thought... We have been able to resolve this as WORKSFORME thanks to a first investigation and verification from Mateusz. This should count as a resolved GCI task. Recreated.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links