Step of Reproduce
- Go to https://en.m.wikiversity.org
- Click On Menu and then Random.
Expected
should be shown only Root Random pages
Actual
There is some page comes, which is not Root Page.
Problem
The problem is that Wikiversity and like sister project have their main content in Root Pages. Subpage may be in bad condition. So Project like Wikiversity needs only show root pages.
QA steps
On beta cluster verify that
- on mobile web, link to random page points to a random article
- Edit the randompage-url and put different location - the Random menu entry should point to that new location
Developer notes
Per @phuedx 's excellent suggestion instead of hardcoding this make use of the MediaWiki message Mediawiki:Random-url
We have a very similar handling when it comes to inserting community portal link (https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/42dce8db1a96ce3f2c5d419b2e95dc03fb7b2284/includes/menu/Definitions.php#L301).
In order to make this work please
- refactor insertCommunityPortal() into sth like buildMenuEntryFromMediaWikiMessage( $message ), and instead of hardcoded Portal-url use the $message variable
- the insertCommunityPortal() method should call buildMenuEntryFromMediaWikiMessage( 'Portal-url' )
- the insertRandomLink() method should call buildMenuEntryFromMediaWikiMessage( 'Random-url' )