Index: trunk/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -469,6 +469,7 @@ |
470 | 470 | really small, and somewhat inconsistent with each other. |
471 | 471 | * (bug 30466) Entries in iwlinks table are now cleared when moving a page over |
472 | 472 | redirect |
| 473 | +* (bug 31674) Can't edit watchlist if it contains special pages |
473 | 474 | |
474 | 475 | === API changes in 1.18 === |
475 | 476 | * BREAKING CHANGE: action=watch now requires POST and token. |
— | — | @@ -697,17 +698,17 @@ |
698 | 699 | MediaWiki.org, and is covered under the GNU Free Documentation License (except |
699 | 700 | for pages that explicitly state that their contents are in the public domain): |
700 | 701 | |
701 | | - http://www.mediawiki.org/wiki/Documentation |
| 702 | + http://www.mediawiki.org/wiki/Documentation |
702 | 703 | |
703 | 704 | == Mailing list == |
704 | 705 | |
705 | 706 | A mailing list is available for MediaWiki user support and discussion: |
706 | 707 | |
707 | | - http://lists.wikimedia.org/mailman/listinfo/mediawiki-l |
| 708 | + http://lists.wikimedia.org/mailman/listinfo/mediawiki-l |
708 | 709 | |
709 | 710 | A low-traffic announcements-only list is also available: |
710 | 711 | |
711 | | - http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce |
| 712 | + http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce |
712 | 713 | |
713 | 714 | It's highly recommended that you sign up for one of these lists if you're |
714 | 715 | going to run a public MediaWiki, so you can be notified of security fixes. |
Index: trunk/phase3/includes/User.php |
— | — | @@ -2606,6 +2606,14 @@ |
2607 | 2607 | } |
2608 | 2608 | |
2609 | 2609 | /** |
| 2610 | + * Cleans up watchlist by removing invalid entries from it |
| 2611 | + */ |
| 2612 | + public function cleanupWatchlist() { |
| 2613 | + $dbw = wfGetDB( DB_MASTER ); |
| 2614 | + $dbw->delete( 'watchlist', array( 'wl_namespace < 0', 'wl_user' => $this->getId() ), __METHOD__ ); |
| 2615 | + } |
| 2616 | + |
| 2617 | + /** |
2610 | 2618 | * Clear the user's notification timestamp for the given title. |
2611 | 2619 | * If e-notif e-mails are on, they will receive notification mails on |
2612 | 2620 | * the next change of the page if it's watched etc. |
Index: trunk/phase3/includes/api/ApiWatch.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $params = $this->extractRequestParams(); |
51 | 51 | $title = Title::newFromText( $params['title'] ); |
52 | 52 | |
53 | | - if ( !$title ) { |
| 53 | + if ( !$title || $titile->getNamespace() < 0 ) { |
54 | 54 | $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) ); |
55 | 55 | } |
56 | 56 | |
Index: trunk/phase3/includes/specials/SpecialEditWatchlist.php |
— | — | @@ -376,8 +376,13 @@ |
377 | 377 | |
378 | 378 | $fields = array(); |
379 | 379 | |
| 380 | + $haveInvalidNamespaces = false; |
380 | 381 | foreach( $this->getWatchlistInfo() as $namespace => $pages ){ |
381 | | - |
| 382 | + if ( $namespace < 0 ) { |
| 383 | + $haveInvalidNamespaces = true; |
| 384 | + continue; |
| 385 | + } |
| 386 | + |
382 | 387 | $namespace == NS_MAIN |
383 | 388 | ? wfMsgHtml( 'blanknamespace' ) |
384 | 389 | : htmlspecialchars( $wgContLang->getFormattedNsText( $namespace ) ); |
— | — | @@ -394,6 +399,10 @@ |
395 | 400 | $fields['TitlesNs'.$namespace]['options'][$text] = $title->getEscapedText(); |
396 | 401 | } |
397 | 402 | } |
| 403 | + if ( $haveInvalidNamespaces ) { |
| 404 | + wfDebug( "User {$this->getContext()->getUser()->getId()} has invalid watchlist entries, clening up...\n" ); |
| 405 | + $this->getContext()->getUser()->cleanupWatchlist(); |
| 406 | + } |
398 | 407 | |
399 | 408 | $form = new EditWatchlistNormalHTMLForm( $fields, $this->getContext() ); |
400 | 409 | $form->setTitle( $this->getTitle() ); |