Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
On installation when setting the field index for data the webform_submitted_data schema must be passed to db_add_index(). Otherwise the user is met with;
Catchable fatal error: Argument 4 passed to db_add_index() must be of the type array, none given.
Proposed resolution
Pass the webform_submitted_data schema to db_add_index().
Reference
https://api.drupal.org/api/drupal/core!includes!database.inc/function/db...
Comment | File | Size | Author |
---|---|---|---|
#9 | webform-db_add_index_does_not-2579569-9.patch | 1.01 KB | tedbow |
#5 | webform-pass-webform-submitted-data-schema-2579569-5.patch | 1.01 KB | dunin |
| |||
#2 | webform-pass-webform-submitted-data-schema-2579569-1-8.patch | 644 bytes | swim |
|
Comments
Comment #2
swim CreditAttribution: swim commentedPlease find patch attached.
Comment #5
dunin CreditAttribution: dunin as a volunteer commentedComment #6
dunin CreditAttribution: dunin as a volunteer commentedReview my patch.
Comment #8
swim CreditAttribution: swim commented8.x-4.x-dev won't pass testing until the actual tests are updated; otherwise we get CI error. Patch in #5 looks good, while db_index_exists and db_driver are available in D8 they'll be deprecated for D9.
Comment #9
tedbow@dunin your patch in #5 worked for me.
I am uploading another version with just a couple small changes.
Just indentation problem.
Call to webform_schema is not needed unless if statement is true.
Comment #10
podarokFixed in latest dev
Comment #12
fenstratAs noted in #2556817-12: Include field specification when adding an index to "data" field for webform_submitted_data the fix that is mentioned in #10 isn't ideal, the fix from #9 is a better solution.
Comment #13
fenstratCommitted and pushed to 8.x-4.x. Thanks!