Forums | Mahara Community

Support /
Can not delete collection


kepa ezquerro's profile picture
Posts: 15

04 February 2022, 4:08

Hello everyone!

I have a problem after a huge upgrade, from 15 to 21 (with steps).

I ll try to explain.

When a user tries to delete a collection from his account it gives an error that says a foreignt key in the table collection_tag is failing.
As I have learned during the upgrades the "_tag" tables where only for the upgrade (correct me if thats not the case please). So I suspect that during the upgrade some of the _tag tables have not been deleted.

This does not happen with every collection, only with some of them, that I suppose are the ones that are include in  the "collection_tag" table.


[WAR] c8 (lib/errors.php:853) Failed to get a recordset: mysqli error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("mahara"."collection_tag", CONSTRAINT "colltag_col_fk" FOREIGN KEY ("collection") REFERENCES "collection" ("id"))] in EXECUTE("DELETE FROM "collection"  WHERE "id" = '3975' ")Command was: DELETE FROM "collection"  WHERE "id" = ?  and values was (0:3975)

The solution could be to delete them mannually?

I ve tried in non productive and it works, but im not sure if that solution is correct or if this could bring more problems in the future.

This are kind of my first steps with mahara, please be nice if this is a stupid question, and I apologize in advance :)

Thanks in advance for your help!

Robert Lyon's profile picture
Posts: 762

06 February 2022, 7:49

Hi Kepa,

Looking at the upgrade code here -> https://git.mahara.org/mahara/mahara/-/blob/master/htdocs/lib/db/upgrade.php#L987
The collection_tag table should have been dropped once all the tags were migrated to the 'tag' table.

Can you check that the tags in those *_tag tables also exist in the 'tag' table? If they do then it should be safe to drop those *_tag tables.

Cheers
Robert

kepa ezquerro's profile picture
Posts: 15

07 February 2022, 21:05

HI!

Thanks for your help!

It looks like the data is there, but some alumns have complained about some missing info in their portfolios, could this be the reason?
Could you please tell me how could I make sure all the data is there or repeat the insert process??


You ve been really helpful! :)
Thanks in advance!



Robert Lyon's profile picture
Posts: 762

15 February 2022, 14:35

Hi Kepa,

It would all depend on what data they think they are missing. Are they

- missing pages

- missing content on pages

- missing tag information stored on pages and / artefacts

- missing access to pages (that exist/show for others)

It might be related to the issue of the tags or it might be something else that didn't go right during an upgrade step.

It's a bit hard to diagnose the problem without more information

Cheers

Robert

4 results