Phuedx has uploaded a new change for review.
https://gerrit.wikimedia.org/r/278715
Change subject: Revert "Don't parse URL to manipulate query parameters"
......................................................................
Revert "Don't parse URL to manipulate query parameters"
This reverts commit 3e6299f24ff136c7fa501cb5bff473339f510bc3, which
caused nightly build failures from Friday, 18th March onwards.
Bug: T129600
Change-Id: Iec1539758533e011ae1c366b7dc1842b46fb9ce2
---
M includes/MobileContext.php
D tests/browser/features/step_definitions/switch_views.rb
D tests/browser/features/step_definitions/switch_views_bug_t129600.rb
D tests/browser/features/support/pages/page.rb
D tests/browser/features/switch_views.feature
5 files changed, 3 insertions(+), 53 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/15/278715/1
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 6c7c134..d972cd3 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -963,7 +963,9 @@
return;
}
- $query = $this->getRequest()->getQueryValues();
+ $url = $this->getRequest()->getFullRequestURL();
+ $parsed = wfParseUrl( $url );
+ $query = isset( $parsed['query'] ) ? wfCgiToArray(
$parsed['query'] ) : array();
unset( $query['mobileaction'] );
unset( $query['useformat'] );
unset( $query['title'] );
diff --git a/tests/browser/features/step_definitions/switch_views.rb
b/tests/browser/features/step_definitions/switch_views.rb
deleted file mode 100644
index 5f289dc..0000000
--- a/tests/browser/features/step_definitions/switch_views.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-Given(/^I toggle the mobile view$/) do
- on(Page).toggle_mobile_view
-end
-
-Then(/^I should see the mobile view$/) do
- expect(on(Page).toggle_view_desktop_element).to be_visible
-end
-
-Given(/^I toggle the desktop view$/) do
- on(Page).toggle_desktop_view
-end
-
-Then(/^I should see the desktop view$/) do
- expect(on(Page).toggle_view_mobile_element).to be_visible
-end
diff --git
a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
b/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
deleted file mode 100644
index 9fb87a6..0000000
--- a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Given(/^I am on a page that transcludes content from a special page$/) do
- api.create_page 'T129600', '{{Special:PrefixIndex/User:Admin/}}'
-
- step 'I am on the "T129600" page'
-end
diff --git a/tests/browser/features/support/pages/page.rb
b/tests/browser/features/support/pages/page.rb
deleted file mode 100644
index 8dc9a6c..0000000
--- a/tests/browser/features/support/pages/page.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class Page
- include PageObject
-
- a(:toggle_view_mobile, css: '.stopMobileRedirectToggle')
- a(:toggle_view_desktop, id: 'mw-mf-display-toggle')
-
- def toggle_mobile_view
- toggle_view_mobile_element.click
- end
-
- def toggle_desktop_view
- toggle_view_desktop_element.click
- end
-end
diff --git a/tests/browser/features/switch_views.feature
b/tests/browser/features/switch_views.feature
deleted file mode 100644
index 724c281..0000000
--- a/tests/browser/features/switch_views.feature
+++ /dev/null
@@ -1,18 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org
@vagrant
-Feature: Switch between mobile and desktop views
-
- Scenario: Switching from desktop view to mobile view
- Given I am on the "Main Page" page
- And I toggle the mobile view
- Then I should see the mobile view
-
- Scenario: Switching from mobile view to desktop view
- Given I am on the "Main Page" page
- And I toggle the mobile view
- And I toggle the desktop view
- Then I should see the desktop view
-
- Scenario: Bug: T129600
- Given I am on a page that transcludes content from a special page
- And I toggle the mobile view
- Then I should see the mobile view
--
To view, visit https://gerrit.wikimedia.org/r/278715
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec1539758533e011ae1c366b7dc1842b46fb9ce2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits