Comment 1 for bug 1515929

Revision history for this message
Robert Lyon (robertl-9) wrote : Re: Copy a collection failing

Hi Ed,

This error is due to your database having duplicate rows in the usr_custom_layout table for the user before they try to copy the collection, of which at least one page has the same layout.

The code is expecting to retrieve only one row to match against the current page being copied.

A few users of mahara have reported this problem but I've yet not been able to replicate how they got duplicate rows in the usr_custom_layout table in the first place.

If you could shed some light on that it would be great.

Anyway a fix for the problem is to remove by first finding them:

 SELECT * FROM usr_custom_layout WHERE usr IS NOT NULL AND usr > 0 ORDER BY usr, layout;

The problem rows should show the same 'usr' id and 'layout' id in pairs.

You just need to pick one of the pair and delete id

Cheers

Robert