Score:0

How to recover 1 missing view and webform out of many after moving to another server?

ng flag

After moving my Drupal 9 site to a different server I see all views in the Views UI, but one. Same with one webform. All are there, but one. I looked in the config database table and the view and blocks are listed there. I don't know if this is a mismatched UUID problem or what. Anybody have any pointers, how I can get that view and webform to show up? I just imported the same Database that was working for the original Drupal 9 site. Do I really have to rebuild them? Seems like a lot of hassle for nothing, since they are in the database.

On the pages where the views blocks were placed, I get of course an error, since the view doesn't exist.

The "views_block:post_other-block_16" was not found

And on the webform page I get an error because I think it can't find the webform.

Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /code/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
#0 /code/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real(2, 'array_flip(): C...', '/code/web/core/...', 312)
#1 [internal function]: _drupal_error_handler(2, 'array_flip(): C...', '/code/web/core/...', 312, Array)
#2 /code/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(312): array_flip(Array)
#3 /code/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(296): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
#4 /code/web/core/lib/Drupal/Core/Entity/EntityBase.php(488): Drupal\Core\Entity\EntityStorageBase->load(NULL)
#5 /code/web/modules/webform/src/Element/Webform.php(39): Drupal\Core\Entity\EntityBase::load(NULL)
#6 [internal function]: Drupal\webform\Element\Webform::preRenderWebformElement(Array)
#7 /code/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#8 /code/web/core/lib/Drupal/Core/Render/Renderer.php(772): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\Core\Ren...')
#9 /code/web/core/lib/Drupal/Core/Render/Renderer.php(363): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#10 /code/web/core/lib/Drupal/Core/Render/Renderer.php(201): Drupal\Core\Render\Renderer->doRender(Array, false)
#11 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
#12 /tmp/rolling/307daff/twig/62284c7206d49_block.html.twig_YWDIpA9i5iaaxIfEH0V1uiMIi/DhVi_sH7DeCKnQFvchxBoEwg5qJtLd0Y0F8pnu-fjXo.php(92): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#13 /code/vendor/twig/twig/src/Template.php(182): __TwigTemplate_3f6686c69176c19ba2b4617cb6325e0a5e759df93b196fc5091701776094356f->block_content(Array, Array)
#14 /tmp/rolling/307daff/twig/62284c7206d49_block.html.twig_YWDIpA9i5iaaxIfEH0V1uiMIi/DhVi_sH7DeCKnQFvchxBoEwg5qJtLd0Y0F8pnu-fjXo.php(76): Twig\Template->displayBlock('content', Array, Array)
#15 /code/vendor/twig/twig/src/Template.php(405): __TwigTemplate_3f6686c69176c19ba2b4617cb6325e0a5e759df93b196fc5091701776094356f->doDisplay(Array, Array)
#16 /code/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#17 /code/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#18 /code/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array)
#19 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/gavias_k...', Array)
#20 /code/web/core/lib/Drupal/Core/Render/Renderer.php(422): Drupal\Core\Theme\ThemeManager->render('block', Array)
#21 /code/web/core/lib/Drupal/Core/Render/Renderer.php(201): Drupal\Core\Render\Renderer->doRender(Array, false)
#22 /code/web/modules/gavias_content_builder/includes/utilities.php(63): Drupal\Core\Render\Renderer->render(Array)
#23 /code/web/themes/gavias_kunco/gva_content_builder/gva_drupal_block.php(107): gavias_content_builder_render_block('webform_2')
#24 /code/web/modules/gavias_content_builder/includes/frontend.php(110): element_gva_drupal_block->render_content(Array, '')
#25 /code/web/modules/gavias_content_builder/includes/frontend.php(54): gavias_content_builder_render_element('gva_drupal_bloc...', Array)
#26 /code/web/modules/gavias_content_builder/includes/frontend.php(22): gavias_content_builder_render_el(Array)
#27 /code/web/modules/gavias_content_builder/src/Plugin/Field/FieldFormatter/GaviasContentBuilderFormatter.php(47): gavias_content_builder_frontend('[{"settings":{"...')
#28 /code/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\gavias_content_builder\Plugin\Field\FieldFormatter\GaviasContentBuilderFormatter->viewElements(Object(Drupal\Core\Field\FieldItemList), 'en')
#29 /code/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(263): Drupal\Core\Field\FormatterBase->view(Object(Drupal\Core\Field\FieldItemList), 'en')
#30 /code/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array)
#31 /code/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full')
#32 /code/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full')
#33 /code/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array)
#34 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build(Array)
#35 /code/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#36 /code/web/core/lib/Drupal/Core/Render/Renderer.php(772): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\Core\Ren...')
#37 /code/web/core/lib/Drupal/Core/Render/Renderer.php(363): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#38 /code/web/core/lib/Drupal/Core/Render/Renderer.php(201): Drupal\Core\Render\Renderer->doRender(Array, false)
#39 /code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(241): Drupal\Core\Render\Renderer->render(Array, false)
#40 /code/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent{closure}()
#41 /code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#42 /code/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#43 /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))
#44 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#45 /code/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#46 /code/vendor/symfony/http-kernel/HttpKernel.php(163): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#47 /code/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#48 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#49 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#50 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#51 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#52 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#53 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#54 /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#55 /code/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#56 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#57 {main}

in flag
Assuming the code and database was transferred as is, there shouldn't be any issues. I would try rebuilding the cache (`drush cr`) or empty all the `cache_*` tables to rule out caching as an issue. Alternatively, you could export the config on the old site into yaml (`drush cex`), ensure that the view and webform actually appears in the yaml, copy the yaml to the new site and import it there (`drush cim`). This is to rule out any outstanding config changes that could be affecting things, as well as allow you to inspect the config as files.
nschildre avatar
ng flag
I already cleared the cache. That was not the problem. And the data for the view is in the database in the config table. I can export it again, but I don't see how that is going to add any information that is not already in the database. Could you explain? So, if those two things do not help, I have to rebuild the view and the webform? No way around it?
in flag
Doing the import from yaml attempts to rule out config issues (it's not necessarily the issue, just rules it out). If your config in yaml looks correct, `cim` should report nothing about it. If `cim` does report an _update_ to that config, that means the yaml and db versions of the config didn't match, and something changed in transit. If the config in the new db got corrupted, the import would correct it assuming a correct yaml. If the view was broken to begin with in the old site, you can export and correct it in yaml, and then import it.
nschildre avatar
ng flag
Thank you! I will try to get the yaml config from the original developer and see if that fixes the problem.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.