← Back to team overview

mahara-contributors team mailing list archive

[Bug 1519780] [NEW] Missing unique index in usr_custom_layout

 

Public bug reported:

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.

** Affects: mahara
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1519780

Title:
  Missing unique index in usr_custom_layout

Status in Mahara:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1519780/+subscriptions


Follow ups