Page MenuHomePhorge

Cannot edit event in Calendar
Open, LowPublic

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

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 claimed this task.
dminuoso reopened this task as Open.EditedFeb 24 2023, 9:10 AM
dminuoso subscribed.

This is an actual bug that should be fixed in master.

It appears to be a regression introduced in b0f306eaf1debac7cb21db93d73232a4c194cff6

Perhaps we need a migration that removes the column altogether?

Thoughts @machniak ?

Fixed via D4112: Default sensitivity to 0 (T7121), but indeed we should remove this column. We found the event sensitivity to be useless and misleading.

machniak lowered the priority of this task from High to Low.Sep 26 2023, 11:34 AM