0

I'm started drupal project (core 9.5.2) installing modules manually (it is not good, i know). After the website is deployed in production, I made changes for configuring composer and all worked well.

As new versions of modules come out, I install them through composer. I use composer require (and the module is installed in /modules/contrib) and then I remove the module folder in /modules, clear the cache and everything works fine. I did this with several modules, such as: ctools, icme, panels, slick, symfony_mailer and others. However, when trying to perform this procedure with the webform, things do not go well (error below). I know that correct way would be to uninstall the module and reinstall it with composer, however, I would lose all the forms created, and all submissions already made. Is there a workaround for this problem?

The website encountered an unexpected error. Please try again later.
Error: Class "Drupal\webform_ui\PathProcessor\WebformUiPathProcessor" not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 273)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 237)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 237)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 136)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 145)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 713)
Drupal\Core\DrupalKernel->handle() (Line: 19)

I tried clear cache with "drush cc" but have same error.

7
  • 1
    Sometimes I've had to restart the webserver after moving modules, as the filepaths get caught up in the serve cache.
    – Jaypan
    Jan 24 at 14:46
  • 1
    Yes, if you are using any memory based cache, restart the instance.
    – Kevin
    Jan 24 at 14:53
  • @Jaypan Thanks for help but, I'm using shared hosting in hostgator, so, I don't know if is possible restart instance. Testing locally, I reboot apache in ubuntu using /etc/init.d/apache2 restart and no success.
    – vctlzac
    Jan 24 at 15:05
  • If your cache lives in the DB (e.g. cache_* tables exist in the DB), backup your DB then truncate those tables (i.e. empty their contents, keep the table). Then try refreshing your page. If your cache is on Redis (I dunno if shared hosting uses Redis but who knows?), flush Redis and refresh the page.
    – Joseph
    Jan 24 at 16:14
  • What is the precise PHP version? There are some issues with autoloading in some version ranges.
    – cilefen
    Jan 24 at 18:57

1 Answer 1

0

After install module via composer (/modules/contrib/webform) and remove manually /modules/webform, execute:

TRUNCATE TABLE cache_bootstrap;
TRUNCATE TABLE cache_config;
TRUNCATE TABLE cache_container;
TRUNCATE TABLE cache_data;
TRUNCATE TABLE cache_default;
TRUNCATE TABLE cache_discovery;
TRUNCATE TABLE cache_dynamic_page_cache;
TRUNCATE TABLE cache_entity;
TRUNCATE TABLE cache_library;
TRUNCATE TABLE cache_menu;
TRUNCATE TABLE cache_page;
TRUNCATE TABLE cache_render;
TRUNCATE TABLE cache_toolbar;

If you use drush, u can use: drush cache-rebuild

2
  • It would be nice to know the precise table to truncate. It can't really require all of them.
    – cilefen
    Jan 25 at 18:48
  • @cilefen I not see a problem do truncate all cache tables.
    – vctlzac
    Jan 25 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.