RandoBogus

Bug: Cannot Delete/remove Lost Parts

Recommended Posts

Absolutely awesome website, I just emerged from the dark ages in large part due to this website!

 

Just wanted to alert someone that there's a database bug in the foreign key constraint between a user's lost parts and their sets.

 

When I try to reduce the quantity of a particular lost part from the lost parts page, I get this error:

ERROR: insert or update on table "user_lost_parts" violates foreign key constraint "user_lost_parts_set_id_fkey" DETAIL: Key (set_id)=(undefined) is not present in table "sets".

When I try to set the quantity of a lost part to zero, nothing happens at all.  If you want a concrete example, I'm trying to modify the lost part count on my 6211-1 Imperial Star Destroyer set.

 

Another oddity is that if I remove the set altogether from my inventory, the lost parts remain (this may have started the problem to begin with).

 

If I had to guess, it seems like the ON DELETE/UPDATE actions in the foreign key constraint are backward.

Share this post


Link to post
Share on other sites

Absolutely awesome website, I just emerged from the dark ages in large part due to this website!

 

Just wanted to alert someone that there's a database bug in the foreign key constraint between a user's lost parts and their sets.

 

When I try to reduce the quantity of a particular lost part from the lost parts page, I get this error:

ERROR: insert or update on table "user_lost_parts" violates foreign key constraint "user_lost_parts_set_id_fkey" DETAIL: Key (set_id)=(undefined) is not present in table "sets".

When I try to set the quantity of a lost part to zero, nothing happens at all.  If you want a concrete example, I'm trying to modify the lost part count on my 6211-1 Imperial Star Destroyer set.

 

Another oddity is that if I remove the set altogether from my inventory, the lost parts remain (this may have started the problem to begin with).

 

If I had to guess, it seems like the ON DELETE/UPDATE actions in the foreign key constraint are backward.

 

Ahh thanks, I saw that error in the log but couldn't figure out how to reproduce it :) Something else I fixed just recently looks like it has broken this, I'll take a look at it tonight (the problem is that it is not getting a valid value for the set_id and so the fk constraint failed).

Share this post


Link to post
Share on other sites

I'm not able to delete spare parts. For example, I have three bricks (all identical) that I want to remove. So I go into parts, select the brick, change the 3 to 0, hit add and I get an error that's the number is invalid. And if I zero the amount and select save, nothing happens. Any suggestions much appreciated.

Share this post


Link to post
Share on other sites

I'm not able to delete spare parts. For example, I have three bricks (all identical) that I want to remove. So I go into parts, select the brick, change the 3 to 0, hit add and I get an error that's the number is invalid. And if I zero the amount and select save, nothing happens. Any suggestions much appreciated.

Where are you trying to delete spare parts from? Only admins (or moc authors for their own mocs) can modify inventories like that.

Share this post


Link to post
Share on other sites

I'm not able to delete spare parts. For example, I have three bricks (all identical) that I want to remove. So I go into parts, select the brick, change the 3 to 0, hit add and I get an error that's the number is invalid. And if I zero the amount and select save, nothing happens. Any suggestions much appreciated.

 

Fixed!

Share this post


Link to post
Share on other sites

I have the exact same problem with lost parts as RandoBogus - can't delete lost parts (0 and nothing happens) and cannot change number of lost parts - I got message as here. And also as with RandoBogus case: "Another oddity is that if I remove the set altogether from my inventory, the lost parts remain (this may have started the problem to begin with)."  I added few lost parts, deleted set, added other lost parts and now I have lost parts added before deleting the set from my sets list. 

 

 

ERROR: insert or update on table "user_lost_parts" violates foreign key constraint "user_lost_parts_set_id_fkey" DETAIL: Key (set_id)=(undefined) is not present in table "sets".

Share this post


Link to post
Share on other sites