Integrity constraint violation: 1048 Column 'severity' cannot be null: INSERT INTO "watchdog"

Created on 14 January 2025, 3 months ago

Problem

There seems to be an error from this module for Drupal <=10. Following is the error:

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'severity' cannot be null: INSERT INTO "watchdog" ("uid", "type", "message", "variables", "severity", "link", "location", "referer", "hostname", "timestamp") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 

Steps to reproduce

Drupal: 10.3.0
This module version: 2.1.2

Proposed resolution

Fix the logging to support Drupal <=10 versions. Error::logException() seems to be only compatible with Drupal 11.x.
See here - https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Utility%2...

Patch is attached for review.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇮🇳India gauravjeet

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024