Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301029

Entity queries with sorting and ordering are not working in a non-default workspace

$
0
0

Problem/Motivation

1. Install latest HEAD (8.7.x) with minimal profile.
2. Enable workspaces, toolbar modules
3. Visit admin/content
4. Change workspace from 'live' to 'stage' (user get redirected to user/1 page)
5. Try to visit admin/content again
Expected:
6. See content listing page

Actual:
6. See 'The website encountered an unexpected error.' After including settings.local.php, would get:


The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Database\DatabaseExceptionWrapper</em>: SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause: SELECT min(node_field_data.nid) AS expression, COALESCE(workspace_association.target_entity_revision_id, base_table.vid) AS vid, base_table.nid AS nid
FROM 
{node} base_table
LEFT OUTER JOIN {workspace_association} workspace_association ON workspace_association.target_entity_type_id = &#039;node&#039; AND workspace_association.target_entity_id = base_table.nid AND workspace_association.workspace = &#039;stage&#039;
LEFT JOIN {node_field_data} node_field_data ON node_field_data.nid = base_table.nid
ORDER BY expression ASC
LIMIT 50 OFFSET 0; Array
(
)
 in <em class="placeholder">Drupal\Core\Entity\EntityListBuilder-&gt;getEntityIds()</em> (line <em class="placeholder">104</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/EntityListBuilder.php</em>). <pre class="backtrace">Drupal\Core\Database\Statement-&gt;execute(Array, Array) (Line: 625)
Drupal\Core\Database\Connection-&gt;query(&#039;SELECT min(node_field_data.nid) AS expression, COALESCE(workspace_association.target_entity_revision_id, base_table.vid) AS vid, base_table.nid AS nid
FROM 
{node} base_table
LEFT OUTER JOIN {workspace_association} workspace_association ON workspace_association.target_entity_type_id = &#039;node&#039; AND workspace_association.target_entity_id = base_table.nid AND workspace_association.workspace = &#039;stage&#039;
LEFT JOIN {node_field_data} node_field_data ON node_field_data.nid = base_table.nid
ORDER BY expression ASC
LIMIT 50 OFFSET 0&#039;, Array, Array) (Line: 87)
Drupal\Core\Database\Driver\mysql\Connection-&gt;query(&#039;SELECT min(node_field_data.nid) AS expression, COALESCE(workspace_association.target_entity_revision_id, base_table.vid) AS vid, base_table.nid AS nid
FROM 
{node} base_table
LEFT OUTER JOIN {workspace_association} workspace_association ON workspace_association.target_entity_type_id = &#039;node&#039; AND workspace_association.target_entity_id = base_table.nid AND workspace_association.workspace = &#039;stage&#039;
LEFT JOIN {node_field_data} node_field_data ON node_field_data.nid = base_table.nid
ORDER BY expression ASC
LIMIT 50 OFFSET 0&#039;, Array, Array) (Line: 510)
Drupal\Core\Database\Query\Select-&gt;execute() (Line: 257)
Drupal\Core\Entity\Query\Sql\Query-&gt;result() (Line: 76)
Drupal\Core\Entity\Query\Sql\Query-&gt;execute() (Line: 104)
Drupal\Core\Entity\EntityListBuilder-&gt;getEntityIds() (Line: 86)
Drupal\Core\Entity\EntityListBuilder-&gt;load() (Line: 234)
Drupal\Core\Entity\EntityListBuilder-&gt;render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController-&gt;listing(&#039;node&#039;)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 665)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 301029

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>