Foreign key constraint missing for profile icons

Bug #805742 reported by Richard Mansfield
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Richard Mansfield

Bug Description

The installation misses a foreign key (the profileicon field of the usr table should refer to the artefact table). This is because of the order in which XMLDB creates tables and keys, but it seems reasonable to fix it up in the postinst function once all the tables exist.

Changed in mahara:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Richard Mansfield (richard-mansfield)
milestone: none → 1.5.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/436
Committed: http://gitorious.org/mahara/mahara/commit/0c9774b9338736189f57bf5cef046425e97bf092
Submitter: Richard Mansfield (<email address hidden>)
Branch: master

commit 0c9774b9338736189f57bf5cef046425e97bf092
Author: Richard Mansfield <email address hidden>
Date: Tue Jul 5 12:10:01 2011 +1200

    Add foreign key constraint on profileicon field of usr table

    Bug #805742

    Also ensures the profileicon field is cleared when the artefact
    it points to gets deleted.

    Change-Id: Idfda6111b3d653e26225bff90500706ec5dd66a7
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: Confirmed → Fix Committed
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Reopening, because the initial commit left a small bug; see https://reviews.mahara.org/481

Changed in mahara:
status: Fix Committed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/481
Committed: http://gitorious.org/mahara/mahara/commit/e8d02087ceabdbb77ac5dbb9bb86fbce872d7fbf
Submitter: Ruslan Kabalin (<email address hidden>)
Branch: master

commit e8d02087ceabdbb77ac5dbb9bb86fbce872d7fbf
Author: Richard Mansfield <email address hidden>
Date: Fri Jul 15 11:11:41 2011 +1200

    Remove profile icon from session on delete (see bug #805742)

    Commit 0c9774b9 added a foreign key constraint on the profile icon
    field of the user table. But when a profile icon is deleted, this
    field isn't updated in the global $USER object, unless the icon is
    deleted from the profile icons page, so the bad profileicon can hang
    around in the session, and then cause an sql error the next time the
    usr table is updated from $USER.

    This change will fix that problem when a user deletes their own
    profile icon, however it may still be possible for the error to occur
    if for example the user is logged in twice.

    Change-Id: I2f8792fcd392be351b8ee9ac77337fd41b046a3d
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
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.