Last modified: 2014-04-17 11:28:39 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 T55477, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53477 - VisualEditor: Edit tab replaced with "Create source" for Education Program pages
VisualEditor: Edit tab replaced with "Create source" for Education Program pages
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
MediaWiki integration (Other open bugs)
unspecified
All All
: High normal
: VE-deploy-2014-04-17
Assigned To: Alex Monk
:
: 56844 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-28 14:40 UTC by Sage Ross
Modified: 2014-04-17 11:28 UTC (History)
8 users (show)

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


Attachments

Description Sage Ross 2013-08-28 14:40:08 UTC
For those with the rights to edit such pages (admins and those with EducationProgram-specific userrights), the Edit button on course pages and institution pages is mislabeled "Create source". (VE is not enabled in the Education Program: namespace, so it should remain simply "Edit".)

Example institution page:
http://en.wikipedia.org/wiki/Education_Program:University_of_Oklahoma

Example course page:
http://en.wikipedia.org/wiki/Education_Program:University_of_Oklahoma/History_of_Science_from_Antiquity_to_Newton_(Fall_2013)
Comment 1 Sage Ross 2013-09-05 19:26:08 UTC
@James: Any chance of getting this fixed soon? Now is when many instructors who are new to Wikipedia will be trying to set up their course pages, and the mislabeled tab is likely to confuse.
Comment 2 Sage Ross 2013-11-10 15:11:43 UTC
*** Bug 56844 has been marked as a duplicate of this bug. ***
Comment 3 Anna Koval 2014-04-08 19:47:18 UTC
Hi James, just noting for the record that this is still quite problematic, and we very much appreciate any efforts to fix it. :)
Comment 4 James Forrester 2014-04-08 19:51:48 UTC
Slinging to Alex – not sure what the fix here would be (it feels like overriding the semantics of a tab is something that should involve a class change, really) – thoughts?
Comment 5 Alex Monk 2014-04-08 22:16:59 UTC
I think VE shouldn't be modifying tabs on pages which aren't articles (check wgIsArticle is true before doing anything).
Comment 6 Gerrit Notification Bot 2014-04-10 17:31:03 UTC
Change 125233 had a related patch set uploaded by Alex Monk:
Only make tab changes on articles

https://gerrit.wikimedia.org/r/125233
Comment 7 Krinkle 2014-04-11 18:31:33 UTC
From a quick investigation it looks like there are about a dozen different ways in which VisualEditor can reasonably find out that the page is not a real wikipage.

Not one of them is being used by EP right now.

* It's pretending to be a wiki page (by having its own namespace and using action=view, albeit overridden, to render the dynamically constructed page).

* Generally this is something we have Special pages for. If the rendering is completely taken over (as in, there is no page table entry, no revisions table entries etc.), it should be a Special page. Or at least a custom namespace with a negative namespace id.

* It abuses existing WikiPage action queries (action=edit, action=delete), which doesn't make sense because it isn't a WikiPage. So inherently this is going to cause trouble because:
  1) They aren't compatible (the query string parameters Action pages take aren't supported, other than title=).
  2) It doesn't scale. Right now they take over move, delete, edit and view. But there are more page actions, and by design they will not support all of them (they override the ones they re-implement and the rest just fails). For example "View history" (action=history) is quite useless right now. And action=edit doesn't work as expected. Not to mention API actions, none of those are working as expected.
  3) Existence check impossible.  Because they aren't actually wiki pages with page and revision ids, existence check isn't possible. ContentModel can't be overridden because it doesn't use wikipage content. All pages are considered inexistent pages in a custom namespace, and then overridden to exist in some cases.

There are many different ways in which EP could indicate in a standard / reliable way that doesn't require other code to hardcode for EP specifically, and it doesn't seem to be using any of them.

I'd say EP should either let us know how to generically detect it without being EP specific, or it should implement support to at least do one thing right. Possibly we could do the latter ourselves (maybe Alex is interested in patching EP).
Comment 8 Alex Monk 2014-04-11 19:04:27 UTC
(In reply to Krinkle from comment #7)
> I'd say EP should either let us know how to generically detect it without
> being EP specific, or it should implement support to at least do one thing
> right. Possibly we could do the latter ourselves (maybe Alex is interested
> in patching EP).

I don't really think this bug is important enough to VE to justify making big changes to how another extension works...
Comment 9 Andrew Green 2014-04-11 19:44:34 UTC
I can look into making the EP extension warn VE through some generic mechanism. The bug is moderately important for users of the extension, and I imagine there's some way to do this without making major changes.

BTW, I wouldn't recommend that anyone try to make major changes to the EP extension, as the plan is just to rewrite it.

The issues Krinkle mentions are certainly valid. Alex's patch also looks like a fine temporary solution. :)
Comment 10 James Forrester 2014-04-11 19:54:37 UTC
(In reply to Andrew Green from comment #9)
> I can look into making the EP extension warn VE through some generic
> mechanism.

Ideally EP would warn VE through the existing generic mechanisms that Krinkle suggested; this would avoid VE having to have EP-specific code in it entirely. :-)


> BTW, I wouldn't recommend that anyone try to make major changes to the EP
> extension, as the plan is just to rewrite it.

Understood. 


> Alex's patch also looks like a fine temporary solution. :)

Alex's patch is necessarily a horrible hack, but yeah…
Comment 11 Gerrit Notification Bot 2014-04-17 03:38:53 UTC
Change 125233 merged by jenkins-bot:
Don't change tabs on Education Program pages

https://gerrit.wikimedia.org/r/125233
Comment 12 Andrew Green 2014-04-17 11:08:31 UTC
Added a comment on the Gerrit change. tl;dr: Is $wgContentNamespaces getting checked? I don't see how EP_NS could be there, and checking it in js seems to fix the issue. Thanks!
Comment 13 Andrew Green 2014-04-17 11:28:39 UTC
P.S. Go to a production wiki and try this in a js console:

mw.config.get('wgContentNamespaces')

The results coincide:

https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L9292-9349

I lost the scent of $wgVisualEditorNamespaces following a brief pursuit, though...

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


Navigation
Links