Page MenuHomePhabricator

can't edit watchlist if it contains a page in the "Special" space
Closed, ResolvedPublic

Description

(at least one) older versions allowed entering pages in the "Special:" space (-1) into the watchlist. with version 1.18, trying to edit the watchlist looks for the corresponding talk page of all the pages in current list, and since "Special:" pages do not have talk pages associated with them, this creates the following exception when trying to use "View and edit watchlis":

the problem can be reproduced by using the API to insert a page in the "Special:" space into the watchlist, e.g. by running the following javascript code:

<code>
$.post(mw.util.wikiScript('api'), {action: 'watch', title: 'Special:Recentchanges', token: mw.user.tokens.get('watchToken')})
</code>

(you'll need to run it again with "unwatch" to make your watchlist editable again).

here is the exception:

<pre>
getTalk does not make any sense for given namespace -1
Backtrace:
#0 /usr/local/apache/common-local/php-1.18/includes/Namespace.php(84): MWNamespace::isMethodValidFor(-1, 'MWNamespace::ge...')
#1 /usr/local/apache/common-local/php-1.18/includes/Title.php(2850): MWNamespace::getTalk(-1)
#2 /usr/local/apache/common-local/php-1.18/includes/specials/SpecialEditWatchlist.php(182): Title->getTalkPage()
#3 /usr/local/apache/common-local/php-1.18/includes/specials/SpecialEditWatchlist.php(149): SpecialEditWatchlist->showTitles(Array, '?????????? ????...')
#4 [internal function]: SpecialEditWatchlist->submitRaw(Array)
#5 /usr/local/apache/common-local/php-1.18/includes/HTMLForm.php(279): call_user_func(Array, Array)
#6 /usr/local/apache/common-local/php-1.18/includes/HTMLForm.php(228): HTMLForm->trySubmit()
#7 /usr/local/apache/common-local/php-1.18/includes/HTMLForm.php(242): HTMLForm->tryAuthorizedSubmit()
#8 /usr/local/apache/common-local/php-1.18/includes/specials/SpecialEditWatchlist.php(76): HTMLForm->show()
#9 /usr/local/apache/common-local/php-1.18/includes/SpecialPageFactory.php(460): SpecialEditWatchlist->execute('raw')
#10 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(224): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#11 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(624): MediaWiki->performRequest()
#12 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(531): MediaWiki->main()
#13 /usr/local/apache/common-local/php-1.18/index.php(57): MediaWiki->run()
#14 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#15 {main}
</pre>


Version: 1.18.x
Severity: normal

Details

Reference
bz31674
TitleReferenceAuthorSource BranchDest Branch
Harmonize Tags on Airflowrepos/data-engineering/airflow-dags!460jebeT336744-Harmonize-tags-in-Airflow-dagsmain
Split cassandra loading jobs by datasetsrepos/data-engineering/airflow-dags!455joalupdate_analytics_cassandra_loadingmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:56 PM
bzimport set Reference to bz31674.
bzimport added a subscriber: Unknown Object (MLST).

btw: i can suggest a "band-aid" patch that will not fix the underlying issue (pages in unwatchable "Special:" space in watchlist), but will eliminate the exception:
in SpecialEditWatchlist.php, just above

$tools[] = Linker::link( $title->getTalkPage(), wfMsgHtml( 'talkpagelinktext' ) );

add

if( $title->getNamespace() !== NS_SPECIAL )