Page MenuHomekolab.org

Cannot edit event in Calendar
Closed, ResolvedPublic

Description

I have this error below when edit event, end the event in calendar is deleted.

DB Error: [7] ERROR: null value in column "sensitivity" violates not-null constraint#012DETAIL: Failing row contains (10, 1, 0, AFBF8EB2B0CD4FFA4DE9AC873C573F23-90A5F510610E9807, , 0, 2022-12-30 12:19:48.527469, 2022-12-30 12:20:27.887391, 0, 2022-12-30 18:00:00, 2022-12-30 18:30:00, , teste-editado, teste a a a a , teste, , , 0, 1, 5, null, , null, , null). (SQL Query: UPDATE "events" SET "changed" = now(), "start" = '2022-12-30 18:00:00', "end" = '2022-12-30 18:30:00', "all_day" = '0', "title" = 'teste-editado', "description" = 'teste a a a a ', "location" = 'teste', "categories" = '', "url" = '', "free_busy" = '1', "priority" = '5', "sensitivity" = NULL, "status" = '', "attendees" = '', "notifyat" = NULL WHERE "event_id" = '10' AND "calendar_id" IN ('1','2')) in /opt/www/roundcubemail-1.5.3/program/lib/Roundcube/rcube_db.php on line 566 (POST /mail/?_task=calendar&_action=event)

Details

Ticket Type
Task

Event Timeline

fabiointegra triaged this task as High priority.Jan 2 2023, 4:05 PM

If I run below in SQL (PostgreSQL), in my case works, but need patch.

CREATE OR REPLACE FUNCTION events_sensitivity_not_null__fn()
  RETURNS TRIGGER 
  LANGUAGE PLPGSQL
  AS
$$
BEGIN
	IF NEW.sensitivity IS NULL THEN
		 NEW.sensitivity := 0;
	END IF;

	RETURN NEW;
END;
$$;



CREATE TRIGGER events_sensitivity_not_null__tr
  BEFORE UPDATE
  ON events
  FOR EACH ROW
  EXECUTE PROCEDURE events_sensitivity_not_null__fn();

Regards

fabiointegra closed this task as Resolved.Sat, Feb 4, 12:31 AM
fabiointegra claimed this task.