When updating from beta16 to beta17 on a test system, this message came up on a white screen:
The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 1 passed to Drupal\webform\WebformTokenManager::__construct() must implement interface Drupal\Core\Config\ConfigFactoryInterface, instance of Drupal\Core\Extension\ModuleHandler given, called in /home/sensarium/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 272 and defined in Drupal\webform\WebformTokenManager->__construct() (line 46 of modules/webform/src/WebformTokenManager.php).
Just to see what would happen, I opened a terminal session and
1. Cleared all caches (drush cr all)
2. Updated everything pending (drush up -y) --- no result from this, there were no pending updates
3. Ran any pending database updates (drush updb -y) -- this did run all the pending SQL updates
4. Cleared caches again (drush cr all)
The four steps above seemed to "fix" things, but I'm not sure exactly what happened. I tested the new version, and it seems to work, but I only tested a simple contact form.
In reference to the other problems in the parent issue, there are no custom handlers, this is a unmodified version of beta16 that was updated.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2017-09-11 08_11_01-MTPuTTY (Multi-Tabbed PuTTY).png | 67.68 KB | John Graffio |
#3 | update_to_beta17_fails-2908014-3.patch | 450 bytes | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedYep, I just did a clean install of beta16, switched to beta17, and ran the update hooks without clearing the cache, and I am seeing the below error.
This indicates that cache must be cleared before executing the webform module's update hooks. I am going to do some more testing.
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedYep clearing the cache before running the update webform hooks is an immediate workaround.
The attached patch adds a cache clear call before the webform update hooks are executed.
Can someone please test it? I will commit it ASAP and tag a new release.
Comment #4
John Graffio CreditAttribution: John Graffio commentedI ran it again on a restored version, with drush only, and it gets hung on an 8048 database update, but when you run
drush updb -y
again, it works. Site seems stable, everything working.
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@John Graffio Did you run the update hooks with the patch from #3?
Comment #6
John Graffio CreditAttribution: John Graffio commented@Jrockowitz - No, I ran this with the stock beta17 update.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@John Graffio I think you are right that running drush updb twice is okay because the first failure is triggering a cache clear. If you can check the patch from #3 I can commit the fix and push a new release.
Comment #8
omdb CreditAttribution: omdb commented@jrockowitz - I just updated with #3 and it worked.
Comment #9
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@omdb Thanks I will commit the patch and tag a new release in the next day or so.
Comment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI committed the patch.
Comment #13
r-m-n CreditAttribution: r-m-n commentedHi. I just had a problem updating to Webform 8.x-5.0-rc3
Now I get a recoverable fatal error:
Recoverable fatal error: Argument 1 passed to Drupal\webform\WebformTokenManager::__construct() must implement interface Drupal\Core\Config\ConfigFactoryInterface, instance of Drupal\Core\Extension\ModuleHandler given, called in /home/rmnighti/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 266 and defined in Drupal\webform\WebformTokenManager->__construct() (line 46 of modules/webform/src/WebformTokenManager.php).
I'm not a Dev and I don't use Drush. What kind of options do I have to fix this?
Comment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedBefore you update the webform module, put your site in maintenance mode, go to /update.php in a web browser, upload the webform module updates, and then run the database updates.
Comment #15
r-m-n CreditAttribution: r-m-n commentedThanks for your quick reply. On running update.php I get the following:
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform Examples requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform Node requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform Templates requires this module.
UNRESOLVED DEPENDENCY
contribute (Missing)
Webform UI requires this module.