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]: <<Unknown error>>: 7 ERROR: LIMIT must not be negative: SELECT "base_table"."vid" AS "vid", "base_table"."mid" AS "mid", max(media_field_data.created) AS "expression"
FROM
"media" "base_table"
LEFT JOIN "media_field_data" "media_field_data" ON "media_field_data"."mid" = "base_table"."mid"
GROUP BY "base_table"."vid", "base_table"."mid"
ORDER BY "expression" DESC NULLS LAST
LIMIT -1 OFFSET 0; Array
(
)
in <em class="placeholder">Drupal\Core\Entity\Query\Sql\Query->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->clientExecute() (Line: 89)
Drupal\Core\Database\StatementWrapperIterator->execute() (Line: 666)
Drupal\Core\Database\Connection->query() (Line: 250)
Drupal\pgsql\Driver\Database\pgsql\Connection->query() (Line: 521)
Drupal\Core\Database\Query\Select->execute() (Line: 148)
Drupal\pgsql\Driver\Database\pgsql\Select->execute() (Line: 288)
Drupal\Core\Entity\Query\Sql\Query->result() (Line: 85)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 531)
Drupal\gutenberg\Service\MediaService->listMedia() (Line: 347)
Drupal\gutenberg\Controller\MediaController->listMedia()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 634)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()
Fiber->start() (Line: 635)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745)
Drupal\Core\DrupalKernel->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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Bildschirmfoto_20260504_001433.png | 164.87 KB | vmario |
Comments
Comment #2
vmario commented