Forums | Mahara Community

Support /
Duplicate My Groups links in profile side block


Geoff Rowland's profile picture
Posts: 108

07 August 2012, 19:19

Hi folks

I recently noticed that My Groups links were duplicated in the Profile side-block of the dashboard page (coded by /theme/raw/templates/sideblocks/profile.tpl) of our Mahara.

This is on a recently upgraded Mahara 1.5.2, though was also on the pre-upgrade 1.4.0 instance (on 64 bit CentOS 5, PostgreSQL 8.4, PHP 5.3)

There are no duplicate records in the group_members table. The My Groups pages accessed from Groups on the menu bar also behave as expected (no duplicates)

Not sure if this is relevant, but we are using 3 Mahara institutions with SSO from 3 Moodle instances (all using the same LDAP authentication). That is, the same user may SSO into Mahara from different Moodles.

In config.php, we have $cfg->usersuniquebyusername = true;

Presume this is a peculiarity of our setup rather than a general bug, though would be grateful for any hints or suggestions?

Thanks

Geoff Rowland's profile picture
Posts: 108

07 August 2012, 20:32

Now sorted. Smile

The grouptype_roles table had duplicate records and deleting the duplicates fixed things.

Still not precisely sure of the cause of the duplication, though similar symptoms were reported in this bug report.

https://bugs.launchpad.net/mahara/+bug/845948

Geoff Rowland's profile picture
Posts: 108

08 August 2012, 10:18

Well, almost...

I have found a few tables with duplicate records, i.e. exact match of all the fields in a record.

In most cases I have removed these manually via phpPgAdmin by adding a new serial (autonumber) field (column) to the table, and constraining this as a primary key. This allows the duplicate records to be deleted. Finally, the temporary primary key field is dropped.

This worked well for the blocktype_installed_category table, where the duplicate records were blocking 1.4.0 to 1.5.2 upgrade. Recent Mahara versions add a primary key to this table which, obviously, has to be unique for each record.

However, some tables just have too many records to do this manually.

So, can any PostgreSQL gurus suggest some SQL to automaticaly identify and delete duplicate records?

Also, any advice as how to stop such duplications happening in the first place will be gratefully received.

As indicated in my previous post, I have no real idea how the record duplications have happened though others have noted similar issues and have encontered a few hints that it may be related to the pg_dump ang psql backup and restore process.

e.g.

https://bugs.launchpad.net/mahara/+bug/845948

https://bugs.launchpad.net/mahara/+bug/620170

Many thanks

Geoff Rowland's profile picture
Posts: 108

08 August 2012, 18:31

OK, Just in case it helps anyone else. the instructions here were good for removing repeated records

http://www.postgresonline.com/journal/archives/22-Deleting-Duplicate-Records-in-a-Table.html

Though still not sure how they arose in the first place

Kristina Hoeppner's profile picture
Posts: 4729

14 August 2012, 5:00

Hello Geoff,

Thanks for reporting the issue and for trying to find a solution yourself. From the bug report at https://bugs.launchpad.net/mahara/+bug/845948 I can see that a couple of changes were made but that a few tables need to be sorted manually. I hope someone else knows more.

Cheers

Kristina

5 results