Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183757

Change subject: WIP: Enter multiple list support
......................................................................

WIP: Enter multiple list support

To get working:
ALTER TABLE watchlist ADD wl_timestamp VARBINARY(14);
ALTER TABLE watchlist  ADD wl_tag VARBINARY(100);
UPDATE watchlist SET wl_tag='watchlist';
insert into watchlist (wl_user,wl_namespace,wl_title,wl_tag) VALUES (3,0, 
'a_page_on_a_new_watchlist','jonslist')
(where 3 is your userid)
Update getTag to return jonslist
Visit Special:EditWatchlist

Change-Id: Ic7c7b384c5aa1af011da5670e406f5d68753df59
---
M includes/collections/WatchlistPageCollection.php
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/183757/1

diff --git a/includes/collections/WatchlistPageCollection.php 
b/includes/collections/WatchlistPageCollection.php
index 03fa98e..1de52d6 100644
--- a/includes/collections/WatchlistPageCollection.php
+++ b/includes/collections/WatchlistPageCollection.php
@@ -8,6 +8,9 @@
  * A collection of items representing a set of pages that the user is watching.
  */
 class WatchlistPageCollection extends PageCollection {
+       public function getTag() {
+               return 'watchlist';
+       }
        /**
         * Get the database associated with the Watchlist.
         * @return DatabaseBase
@@ -33,6 +36,7 @@
                        ),
                        array(
                                'wl_user' => $this->getOwner()->getId(),
+                               'wl_tag' => $this->getTag(),
                        ),
                        __METHOD__,
                        array( 'ORDER BY' => array( 'wl_namespace', 'wl_title' 
) )
@@ -62,7 +66,10 @@
                $dbw = $this->getDatabase();
                $dbw->delete(
                        'watchlist',
-                       array( 'wl_user' => $this->getOwner()->getId() ),
+                       array(
+                               'wl_user' => $this->getOwner()->getId(),
+                               'wl_tag' => $this->getTag(),
+                       ),
                        __METHOD__
                );
        }
@@ -82,6 +89,7 @@
                                'wl_namespace' => MWNamespace::getSubject( 
$title->getNamespace() ),
                                'wl_title' => $title->getDBkey(),
                                'wl_notificationtimestamp' => null,
+                               'wl_tag' => $this->getTag(),
                        );
                        // add talk page
                        $rows[] = array(
@@ -89,6 +97,7 @@
                                'wl_namespace' => MWNamespace::getTalk( 
$title->getNamespace() ),
                                'wl_title' => $title->getDBkey(),
                                'wl_notificationtimestamp' => null,
+                               'wl_tag' => $this->getTag(),
                        );
                }
 
@@ -105,6 +114,7 @@
                                        'wl_user' => $this->getOwner()->getId(),
                                        'wl_namespace' => 
MWNamespace::getSubject( $title->getNamespace() ),
                                        'wl_title' => $title->getDBkey(),
+                                       'wl_tag' => $this->getTag(),
                                ),
                                __METHOD__
                        );
@@ -116,6 +126,7 @@
                                        'wl_user' => $this->getOwner()->getId(),
                                        'wl_namespace' => MWNamespace::getTalk( 
$title->getNamespace() ),
                                        'wl_title' => $title->getDBkey(),
+                                       'wl_tag' => $this->getTag(),
                                ),
                                __METHOD__
                        );

-- 
To view, visit https://gerrit.wikimedia.org/r/183757
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7c7b384c5aa1af011da5670e406f5d68753df59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to