So, I'm attempting to perform an early migration on a simple site, where the only major contrib module used is Webform, but I'm running into a problem using Webform with the latest dev code for Drupal 8. I'm working with git clones of both Drupal 8 and Webform. But this error doesn't make any sense to me. It almost seems like I've installed MySQL incorrectly. I haven't worked much with Drupal 8 so far, so I'm pretty ignorant of what I might be doing wrong. The following is the error message I see trying to enable webform with Drush. It actually seems to be enabled in the modules list, but the content type is not registered properly.
drush en webform
The following extensions will be enabled: webform
Do you really want to continue? (y/n): y
exception 'Drupal\Core\Database\SchemaException' with message 'MySQL needs the 'data' field specification in order to normalize the 'data' index' in [error]
/Volumes/knope/work/Drupal/d8/public/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php:331
Stack trace:
#0 /Volumes/knope/work/Drupal/d8/public/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php(508): Drupal\Core\Database\Driver\mysql\Schema->getNormalizedIndexes(Array)
#1 /Volumes/knope/work/Drupal/d8/public/core/includes/database.inc(922): Drupal\Core\Database\Driver\mysql\Schema->addIndex('webform_submitt...', 'data', Array, NULL)
#2 /Volumes/knope/work/Drupal/webform/webform.install(756): db_add_index('webform_submitt...', 'data', Array)
#3 [internal function]: webform_install()
#4 /Volumes/knope/work/Drupal/d8/public/core/lib/Drupal/Core/Extension/ModuleHandler.php(383): call_user_func_array('webform_install', Array)
#5 /Volumes/knope/work/Drupal/d8/public/core/lib/Drupal/Core/Extension/ModuleInstaller.php(263): Drupal\Core\Extension\ModuleHandler->invoke('webform', 'install')
#6 /Volumes/knope/work/Drupal/d8/public/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(87): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#7 /usr/local/Cellar/drush/HEAD/libexec/commands/core/drupal/environment.inc(130): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#8 /usr/local/Cellar/drush/HEAD/libexec/commands/core/drupal/environment.inc(197): drush_module_install(Array)
#9 /usr/local/Cellar/drush/HEAD/libexec/commands/pm/pm.drush.inc(1120): drush_module_enable(Array)
#10 [internal function]: drush_pm_enable('webform')
#11 /usr/local/Cellar/drush/HEAD/libexec/includes/command.inc(368): call_user_func_array('drush_pm_enable', Array)
#12 /usr/local/Cellar/drush/HEAD/libexec/includes/command.inc(219): _drush_invoke_hooks(Array, Array)
#13 [internal function]: drush_command('webform')
#14 /usr/local/Cellar/drush/HEAD/libexec/includes/command.inc(187): call_user_func_array('drush_command', Array)
#15 /usr/local/Cellar/drush/HEAD/libexec/lib/Drush/Boot/BaseBoot.php(62): drush_dispatch(Array)
#16 /usr/local/Cellar/drush/HEAD/libexec/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#17 /usr/local/Cellar/drush/HEAD/libexec/drush.php(11): drush_main()
#18 {main}
Comments
Comment #2
danchadwick commentedTHe D8 branch if far, far, far, from done. The massive amount of work has just begun.
Comment #3
safetypinI can see that. But webform installation works in beta-14 and fails in the dev branch.
Maybe a better question is: Are you only focusing on making webform work with the beta releases? Seems reasonable, especially if this error is related to incomplete core code? It seems to me, if webform won't even install on the dev branch, that's a pretty serious problem.
Comment #4
safetypinI'd like to help out, as this is a vitally important module to nearly every web site I've built in Drupal. So, should I be working on the webform code installed in a beta release environment instead of the dev branch of core?
Comment #5
danchadwick commentedI'm not actively working on the D8 branch. That effort is being lead by user fenstrat. You might ping him.
I would think that you should be using the latest beta core for testing to avoid chasing red herrings. That said, if stuff has changed in dev, it will probably need to be addressed in webform at some point.
fenstrat would certainly welcome concerted efforts from other contributors. I would guess that a dozen person-months of developer effort is needed to get to a alpha or beta quality release.
Comment #7
safetypinAfter running into this issue with beta15, I did some additional investigation, and it looks like the problem is line #756 in webform.install. This function call "add_db_index" appears to need an additional parameter ($spec). I'm really just guessing about this, because although I have a basic understanding of indexes, the intricacies of the database abstraction layer are still pretty mysterious to me.
I'm unsure of how to complete additional testing, but this patch resolves the installation error for me.
Comment #8
luuph commentedJust confirming that patch in #7 solves installation eroor for me too.
Comment #9
podarok#7 works fine and works for 8.x-4.x as well
Comment #10
podarokfixed in latest 8.x-4.x dev
Comment #12
fenstratThe solution here in #7 committed in 9d8c016 isn't ideal. It passes a incomplete $spec parameter. A better solution is in #2579569: db_add_index does not receive webform_submitted_data schema which I'm marking this as a duplicate of.