Problem/Motivation

When editing a site with Gutenberg 4.0-beta2, i cannot see the images in a gallery which were uploaded in previous edit. The browser console throws following error:

Auf der Website ist ein unerwarteter Fehler aufgetreten. Versuchen Sie es später noch einmal.<br><br><em class="placeholder">Drupal\Core\Database\DatabaseExceptionWrapper</em>: SQLSTATE[2201W]: &lt;&lt;Unknown error&gt;&gt;: 7 ERROR:  LIMIT must not be negative: SELECT &quot;base_table&quot;.&quot;vid&quot; AS &quot;vid&quot;, &quot;base_table&quot;.&quot;mid&quot; AS &quot;mid&quot;, max(media_field_data.created) AS &quot;expression&quot;
FROM
&quot;media&quot; &quot;base_table&quot;
LEFT JOIN &quot;media_field_data&quot; &quot;media_field_data&quot; ON &quot;media_field_data&quot;.&quot;mid&quot; = &quot;base_table&quot;.&quot;mid&quot;
GROUP BY &quot;base_table&quot;.&quot;vid&quot;, &quot;base_table&quot;.&quot;mid&quot;
ORDER BY &quot;expression&quot; DESC NULLS LAST
LIMIT -1 OFFSET 0; Array
(
)
 in <em class="placeholder">Drupal\Core\Entity\Query\Sql\Query-&gt;result()</em> (line <em class="placeholder">288</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Query/Sql/Query.php</em>). <pre class="backtrace">Drupal\Core\Database\Statement\StatementBase-&gt;clientExecute() (Line: 89)
Drupal\Core\Database\StatementWrapperIterator-&gt;execute() (Line: 666)
Drupal\Core\Database\Connection-&gt;query() (Line: 250)
Drupal\pgsql\Driver\Database\pgsql\Connection-&gt;query() (Line: 521)
Drupal\Core\Database\Query\Select-&gt;execute() (Line: 148)
Drupal\pgsql\Driver\Database\pgsql\Select-&gt;execute() (Line: 288)
Drupal\Core\Entity\Query\Sql\Query-&gt;result() (Line: 85)
Drupal\Core\Entity\Query\Sql\Query-&gt;execute() (Line: 531)
Drupal\gutenberg\Service\MediaService-&gt;listMedia() (Line: 347)
Drupal\gutenberg\Controller\MediaController-&gt;listMedia()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 634)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()
Fiber-&gt;start() (Line: 635)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle() (Line: 53)
Drupal\Core\StackMiddleware\Session-&gt;handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength-&gt;handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle() (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass() (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle() (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware-&gt;handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle() (Line: 745)
Drupal\Core\DrupalKernel-&gt;handle() (Line: 19)
</pre>

Steps to reproduce

- Create a page, add a gallery with some images, save
- edit the page again

Proposed resolution

- fix the limit issue "ERROR: LIMIT must not be negative"

Remaining tasks

User interface changes

API changes

Data model changes

Setup:
- Used Drupal: 11.3.8
- PHP: 8.4.20
- DB: PgSQL 16.13

CommentFileSizeAuthor
#2 Bildschirmfoto_20260504_001433.png164.87 KBvmario

Comments

vmario created an issue. See original summary.

vmario’s picture

StatusFileSize
new164.87 KB