Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 25017)
+++ src/wp-includes/query.php	(working copy)
@@ -2083,14 +2083,23 @@
 		if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) {
 			foreach ( (array)$q['post_type'] as $_post_type ) {
 				$ptype_obj = get_post_type_object($_post_type);
-				if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
+				if ( ! $ptype_obj )
 					continue;
 
+				// Map 'name' to 'postname' for hierarchical post types without a custom query_var
+				if ( ! $ptype_obj->query_var && $ptype_obj->hierarchical && strpos( $q['name'], '/' ) !== false ) {
+					$q['pagename'] = $q['name'];
+					$q['name'] = '';
+				}
+
+				if ( ! $ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
+					continue;
+
 				if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false ) {
 					// Non-hierarchical post_types & parent-level-hierarchical post_types can directly use 'name'
 					$q['name'] = $q[ $ptype_obj->query_var ];
 				} else {
-					// Hierarchical post_types will operate through the
+					// Hierarchical post_types will operate through the 'pagename' query var
 					$q['pagename'] = $q[ $ptype_obj->query_var ];
 					$q['name'] = '';
 				}
