Drupal\Core\Database\Query\Insert::fields() must be of the type array, null given, called in modules/contrib/viewsreference/viewsreference.install on line 71 in Drupal\Core\Database\Query\Insert->fields()
In PHP7.1
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2921423-3.patch | 1.89 KB | rajab natshah |
Comments
Comment #2
rajab natshahComment #3
rajab natshahComment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahComment #7
seanbThe table fields array should never be null? Do you have a backup with a copy of your table structure from before the update? And did you have the 1.x version of the module installed before running the updates?
I think this patch hides an error that shouldn't happen, so I think it would be good to get to the bottom of this.
Comment #8
rajab natshahSean agree with you,
I'm doing this from an installation profile version to the next one, please do not worry about backups.
It's paragraphs field in a content type.
Having more troubleshooting over this patch.
Testing after the viewsreference 8.x-2.0-alpha3 release.
Comment #9
anybodyThe patch works and is RTBC.
Hint: Using !empty() would have been a bit shorter but I think it's not worth to discuss that ;)
This happens if the update runs partially and some tables are already convertet.
Comment #10
seanb#9 @Anybody, seems fair enough.
Small change to the patch, fixing this on commit.
We could probably do a
!empty($table_field) && is_array($table_fields). The empty check will take care of the isset and count > 0 at the same time.Comment #12
seanbAdded to the latest dev. Please test it and let me know if there are any issues.
Comment #13
anybodyPerfect, thanks a lot to both of you :)