Missing unique index in usr_custom_layout

Bug #1519780 reported by Howard Miller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
New
Undecided
Unassigned

Bug Description

We had some issues with duplicate records in usr_custom_layout when creating a page from a template. In lib/view.php, function create_from_template, there is the database read...

$haslayout = get_record('usr_custom_layout', 'layout', $template->get('layout'), 'usr', $owner);

This failed because more than one record was returned. I have no idea what caused this but it would have been more robust if ('usr', 'layout') was defined as a unique index.

The problem occurred in 15.04 with MySQL. A quick glance suggests that nothing has changed in this area in 15.10.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Howard,

We actually just addressed this issue in Bug 1515929, which was included in the minor release 15.10.1 that came out three days ago.

I neglected to backport the fix to 15.04 and 1.10, but we probably should because they're probably affected as well. I'll update the bug to put them in the next minor release for those. In the meantime, you can try applying the patch for that issue manually.

Cheers,
Aaron

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.