Last modified: 2014-02-12 23:55:02 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 T47315, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45315 - Fatal error: Call to undefined method DeviceProperties::moduleName() on MediaWiki 1.20.2
Fatal error: Call to undefined method DeviceProperties::moduleName() on Media...
Status: RESOLVED WONTFIX
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All Linux
: Unprioritized major
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-23 22:13 UTC by Greg Thorne
Modified: 2014-02-12 23:55 UTC (History)
11 users (show)

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


Attachments

Description Greg Thorne 2013-02-23 22:13:09 UTC
Most recent MediaWiki version (did a 'git clone' in the extensions dir).  I am running MW 10.20.2.  After doing the 'git clone' in my extensions directory, I added the line 

require_once("$IP/extensions/MobileFrontend/MobileFrontend.php");

right before the closing ?> in LocalSettings.php.

When I load up the wiki and click on the 'mobile version' link at the bottom, I get this error (I've changed my domain name and username):

Fatal error: Call to undefined method DeviceProperties::moduleName() in /home/username/mydomain.com/wiki/extensions/MobileFrontend/includes/skins/SkinMobile.php on line 317

I did a 'find' command from the prompt to see where the DeviceProperties class lives.  I'm not sure if this is helpful, but here is the output anyway:

$ find . -exec grep DeviceProperties {} \; -print
interface IDeviceProperties {
	 * @return IDeviceProperties
	function detectDeviceProperties( $userAgent, $acceptHeader = '' );
	 * @return IDeviceProperties
	function getDeviceProperties( $deviceName, $userAgent );
 * MediaWiki's default IDeviceProperties implementation
final class DeviceProperties implements IDeviceProperties {
	 * @return IDeviceProperties
	public function detectDeviceProperties( $userAgent, $acceptHeader = '' ) {
		return $this->getDeviceProperties( $deviceName, $userAgent );
	 * @return IDeviceProperties
	public function getDeviceProperties( $deviceName, $userAgent ) {
			return new DeviceProperties( self::$formats[$deviceName], $userAgent );
			return new DeviceProperties( array(
./extensions/MobileFrontend/includes/DeviceDetection.php
	/** @var IDeviceProperties */
	 * @return IDeviceProperties
			$this->device = $detector->getDeviceProperties( $formatName, $userAgent );
			$this->device = $detector->detectDeviceProperties( $userAgent, $acceptHeader );
./extensions/MobileFrontend/includes/MobileContext.php
	protected function attachResources( Title $title, QuickTemplate $tpl, IDeviceProperties $device ) {
./extensions/MobileFrontend/includes/skins/SkinMobile.php
		$device = $detector->getDeviceProperties( $format, '' );
		$device = $detector->getDeviceProperties( $format, '' );
		$device = $detector->detectDeviceProperties( $userAgent );
./extensions/MobileFrontend/tests/DeviceDetectionTest.php
		$device = $detector->getDeviceProperties( 'webkit', '' );
./extensions/MobileFrontend/tests/SkinMobileTest.php
	'DeviceProperties' => 'includes/mobile/DeviceDetection.php',
	'IDeviceProperties' => 'includes/mobile/DeviceDetection.php',
./includes/AutoLoader.php
interface IDeviceProperties {
	 * @return IDeviceProperties
	function detectDeviceProperties( $userAgent, $acceptHeader = '' );
	 * @return IDeviceProperties
	function getDeviceProperties( $deviceName );
 * MediaWiki's default IDeviceProperties implementation
final class DeviceProperties implements IDeviceProperties {
	 * @deprecated: Deprecated, will be removed once detectDeviceProperties() will be deployed everywhere on WMF
	 * @return IDeviceProperties
	public function detectDeviceProperties( $userAgent, $acceptHeader = '' ) {
		return $this->getDeviceProperties( $deviceName );
	 * @deprecated: Deprecated, will be removed once detectDeviceProperties() will be deployed everywhere on WMF
	 * @return IDeviceProperties
	public function getDeviceProperties( $deviceName ) {
			return new DeviceProperties( self::$formats[$deviceName] );
			return new DeviceProperties( array(
./includes/mobile/DeviceDetection.php


Here's the version information from Special:Version:

Product 	Version
MediaWiki 	1.20.2
PHP 	5.3.13 (cgi-fcgi)
MySQL 	5.1.56-log
Comment 1 Jon 2013-02-27 01:43:05 UTC
Sounds like bug 44068 - will need to check when DeviceDetection got removed from core - but MediaWiki shouldn't provide an implementation of IDeviceProperties.

It's possible this is fixed in the latest development version but hasn't made it into a MediaWiki release yet...
Comment 2 Max Semenik 2013-02-27 08:35:22 UTC
Unfortunately, latest MobileFrontend doesn't work with anything but MediaWiki master, so even if we fix this particular issue by removing a line from AutoLoader.php, MobileFrontend will still not work for you as it requires mobile support in ResourceLoader. The only option here is to either upgrade MediaWiki to a git  cheeckout (sounds scary), or stick with MobileFrontend REL1_20 branch which is known to work with MW 1.20.
Comment 3 Nick 2013-03-14 22:30:13 UTC
REL1_20 branch works with MW 1.20.3 but mobile device autodetection doesn't seem to work.

Is there a way to make REL1_20 use some kind of mobile autodetection?
Comment 4 Max Semenik 2013-03-14 22:37:51 UTC
Sorry, but in addition to DeviceDetection changes, master MobileFrontend requires a bunch more of core changes only present in 1.21alpha, so there's no chance of backporting or backwards-compatible MF release.

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


Navigation
Links