--- a/src/ImageCaptionStorage.php +++ b/src/ImageCaptionStorage.php @@ -405,17 +405,22 @@ $list = &drupal_static(__FUNCTION__); if (!isset($list[$key])) { - // Query. - $query = $this->database->select($this->tableData, 'ifc'); - $result = $query - ->fields('ifc', [$key]) - ->distinct() - ->execute() - ->fetchAll(); - $list[$key] = []; - foreach ($result as $row) { - $list[$key][] = $row->{$key}; + try { + // Query. + $query = $this->database->select($this->tableData, 'ifc'); + $result = $query + ->fields('ifc', [$key]) + ->distinct() + ->execute() + ->fetchAll(); + + foreach ($result as $row) { + $list[$key][] = $row->{$key}; + } + } + catch (\Exception $e) { + // Table may not exist when the module uses default field storage. } }