Add null check for $project in the template/starred-projects.php#19
Add null check for $project in the template/starred-projects.php#19techu wants to merge 1 commit intobiblibre:masterfrom
Conversation
This fixes an issue where if a starred project is deleted the dashboard "starred projects" listings shows error on the frontend.
|
Can you describe the steps needed to reproduce the issue ? |
Apparently this does not happening. If a project is deleted the table entries in "starred_projects" table still remains and the users whom had the deleted project as favorite will receive errors like: |
|
Which database engine are you using ? Can you show the CREATE TABLE statement for table starred_projects ? |
|
This is the case at least with DB postgresql: CREATE TABLE IF NOT EXISTS public.starred_projects
(
id integer NOT NULL DEFAULT nextval('starred_projects_id_seq'::regclass),
user_id integer NOT NULL,
project_id integer NOT NULL,
CONSTRAINT starred_projects_pkey PRIMARY KEY (id),
CONSTRAINT starred_projects_user_id_project_id_key UNIQUE (user_id, project_id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.starred_projects
OWNER to kanboard;To reproduce the issue, create a project, set it a starred project then delete the project |
|
The foreign key constraints are not there. They should be. Looking at the repository history, the first versions of the plugin did not have these foreign key constraints. They were added later but without an "upgrade path". So, assuming you are using the latest version of the plugin, I guess you started using an early version that did not have these constraints and upgraded from there. |
This fixes an issue where if a starred project is deleted the dashboard "starred projects" listings shows error on the frontend.