Module install fails with a white screen error that starts like:
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'owner' cannot be null
...
Refreshing the page shows the module as enabled but it does not work. This install error seems to happen because the schema sets 'owner' as not null while $theme->owner can be null (ThemeHandler class's $theme->owner calls Extension::getExtensionPathname which returns string or null). I am not sure what causes $theme->owner to be null but it is a valid value.
One easy fix would be to change
$data['owner'] = $theme->owner;
to:
$data['owner'] = !empty($theme->owner) ? $theme->owner : '';
similar to other fields that are checked to see if they are empty.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | theme-empty-check_2753859.patch | 1.79 KB | jalpesh |
Comments
Comment #2
jalpesh commentedI have added empty check at some places including $theme->owner.
Comment #3
rjg commentedThe patch worked. Thank you.
Comment #4
jalpesh commented@rjg,
Thank you for testing the patch. I think we should mark as RTBC(Review and tested by community) instead of fix. Let maintainer of this module commit the changes and then anyone can mark as fix. Thanks.