I get an error when previewing a node.

Created on 17 August 2019, over 5 years ago
Updated 5 June 2024, 7 months ago

Probably the error occurs when the field to calculate for readtime is empty.
After hiding the readtime field from view mode, there was no error.

Some error messages are:

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'nid' cannot be null: INSERT INTO {read_time} (nid, read_time) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 0 ) in Drupal\Core\Database\Connection->handleQueryException() (line 689 of /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Database/Connection.php).

Warning: Illegal string offset 'value' in Drupal\views\Plugin\views\area\Text->preQuery() (line 50 of /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/Plugin/views/area/Text.php) #0 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/includes/bootstrap.inc(587): _drupal_error_handler_real(2, 'Illegal string ...', '/srv/bindings/5...', 50, Array) #1 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/Plugin/views/area/Text.php(50): _drupal_error_handler(2, 'Illegal string ...', '/srv/bindings/5...', 50, Array) #2 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/ViewExecutable.php(1011): Drupal\views\Plugin\views\area\Text->preQuery() #3 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/ViewExecutable.php(1233): Drupal\views\ViewExecutable->_preQuery() #4 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/Plugin/views/display/PathPluginBase.php(390): Drupal\views\ViewExecutable->build() #5 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/Plugin/views/display/Page.php(180): Drupal\views\Plugin\views\display\PathPluginBase->execute() #6 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/ViewExecutable.php(1630): Drupal\views\Plugin\views\display\Page->execute() #7 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/views/src/Element/View.php(77): Drupal\views\ViewExecutable->executeDisplay('page', Array) #8 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array) #9 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Render/Renderer.php(378): call_user_func(Array, Array) #10 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false) #11 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\Core\Render\Renderer->render(Array, false) #12 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() #13 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #14 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) #15 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch)) #16 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #17 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #18 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/vendor/symfony/http-kernel/HttpKernel.php(156): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent)) #19 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #20 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /srv/bindings/551d86133a374fbd8e5ab32def27ab47/code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #29 {main}.

Thank you.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇯🇵Japan s-jack Tokyo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024