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.

CommentFileSizeAuthor
#2 theme-empty-check_2753859.patch1.79 KBjalpesh

Comments

rjg created an issue. See original summary.

jalpesh’s picture

Status: Active » Needs review
StatusFileSize
new1.79 KB

I have added empty check at some places including $theme->owner.

rjg’s picture

Status: Needs review » Fixed

The patch worked. Thank you.

jalpesh’s picture

Status: Fixed » Reviewed & tested by the community

@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.