Index: /branches/release-39/php/lib/block.mtentries.php
===================================================================
--- /branches/release-39/php/lib/block.mtentries.php (revision 2294)
+++ /branches/release-39/php/lib/block.mtentries.php (revision 2496)
@@ -17,9 +17,14 @@
         // break that context, clear the stashed entries so fetch_entries
         // can reselect.
-        if ($ctx->stash('entries') &&
-            (isset($args['category']) || isset($args['categories']) ||
-             isset($args['tag']) || isset($args['tags']) ||
-             isset($args['id']) ||
-             isset($args['author']) ||
+        $this_tag = strtolower($ctx->this_tag());
+        if (($this_tag == 'mtentries') || ($this_tag == 'mtpages')) {
+            if ($ctx->stash('entries') &&
+                (isset($args['category']) || isset($args['categories']) ||
+                 isset($args['tag']) || isset($args['tags']) ||
+                 isset($args['author']) ))
+                $ctx->__stash['entries'] = null;
+        }
+        if ($ctx->__stash['entries'] &&
+            (isset($args['id']) ||
              isset($args['recently_commented_on']) ||
              isset($args['include_subcategories']) ||
Index: /branches/release-39/php/lib/block.mtpages.php
===================================================================
--- /branches/release-39/php/lib/block.mtpages.php (revision 1335)
+++ /branches/release-39/php/lib/block.mtpages.php (revision 2496)
@@ -47,3 +47,2 @@
     return $out;
 }
-?>
Index: /branches/release-39/lib/MT/Template/ContextHandlers.pm
===================================================================
--- /branches/release-39/lib/MT/Template/ContextHandlers.pm (revision 2464)
+++ /branches/release-39/lib/MT/Template/ContextHandlers.pm (revision 2496)
@@ -7538,8 +7538,27 @@
         $entries = undef if $entry->class ne $class_type;
 
-        foreach my $args_key ('category', 'categories', 'tag', 'tags', 'author', 'id', 'days', 'recently_commented_on', 'include_subcategories', 'include_blogs', 'exclude_blogs', 'blog_ids') {
-            if (exists($args->{$args_key})) {
-                $entries = undef;
-                last;
+        # For the stock Entries/Pages tags, clear any prepopulated
+        # entries list (placed by archive publishing) if we're invoked
+        # with any of the following attributes. A plugin tag may
+        # prepopulate the entries stash and then invoke this handler
+        # to permit further filtering of the entries.
+        my $tag = lc $ctx->stash('tag');
+        if ($entries && (($tag eq 'entries') || ($tag eq 'pages'))) {
+            foreach my $args_key ('category', 'categories', 'tag', 'tags',
+                'author') {
+                if (exists($args->{$args_key})) {
+                    $entries = undef;
+                    last;
+                }
+            }
+        }
+        if ( $entries ) {
+            foreach my $args_key ('id', 'days', 'recently_commented_on',
+                'include_subcategories', 'include_blogs', 'exclude_blogs',
+                'blog_ids') {
+                if (exists($args->{$args_key})) {
+                    $entries = undef;
+                    last;
+                }
             }
         }
