- Issue created by @2dareis2do
Drupal\Core\Entity\EntityStorageException: Field is unknown. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
When configuring content type to send notification to on publish, if you do not specify body and icon, then you get EntityStorageException
changing
// Prepare a notification info.
if (isset($fields['body'])) {
$item->body = $entity->get($fields['body'])->value;
}
// Prepare a notification icon.
if (isset($fields['icon'])) {
$item->icon = $this->getIconUrl($entity->get($fields['icon']));
}
to
// Prepare a notification info.
if (isset($fields['body']) && !empty($fields['body'])) {
$item->body = $entity->get($fields['body'])->value;
}
// Prepare a notification icon.
if (isset($fields['icon']) && !empty($fields['icon'])) {
$item->icon = $this->getIconUrl($entity->get($fields['icon']));
}
in
web/modules/contrib/web_push_notification/src/NotificationQueue.php
for now.
Active
1.0
Code