Error on registration if confirmed registration is turned on and copy collection in play

Bug #1367939 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
1.7
Fix Released
High
Robert Lyon
1.8
Fix Released
High
Robert Lyon
1.9
Fix Released
High
Robert Lyon

Bug Description

If you have an institution with:
- both "Registration allowed" and "Confirm registration" chosen in it's config.
- a collection that has the "Copy for new institution members" checked (under Admin -> Institution -> Share -> [name of collection] -> Advanced options)

When a new user registers the admin gets an email to approve them, and on approval, the new user gets an email to complete signup.

When the user clicks the complete signup link we get an error like:

[WAR] 5f (lib/view.php:503) View::_create: User 0 is not allowed to create a view for owner 13
Call stack (most recent first):

    View::_create(array(size 5), 0) at /home/robertl/htdocs/mahara-devel/mahara/htdocs/lib/view.php:371
    View::create_from_template(array(size 5), "18", 0, false, true) at /home/robertl/htdocs/mahara-devel/mahara/htdocs/lib/collection.php:274
    Collection::create_from_template(array(size 1), "2", null, false, true) at /home/robertl/htdocs/mahara-devel/mahara/htdocs/auth/user.php:1302
    User->copy_institution_views_collections_to_new_member("squid") at /home/robertl/htdocs/mahara-devel/mahara/htdocs/lib/institution.php:338
    Institution->addUserAsMember(object(User)) at /home/robertl/htdocs/mahara-devel/mahara/htdocs/auth/user.php:683
    User->join_institution("squid") at /home/robertl/htdocs/mahara-devel/mahara/htdocs/register.php:150
    create_registered_user() at /home/robertl/htdocs/mahara-devel/mahara/htdocs/register.php:198

The problem being the system doesn't 'know' who is the authority user giving permission for this new user to copy the collection and so tries to do it with guest user (userid = 0).

We need to have a way of either working out who the authority user id would be - or ignore it in this particular case (if safe to do)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3691

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3691
Committed: http://gitorious.org/mahara/mahara/commit/69041d9e60de31b73ba0c18efc22cfa47598ef63
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 69041d9e60de31b73ba0c18efc22cfa47598ef63
Author: Robert Lyon <email address hidden>
Date: Thu Sep 11 10:47:05 2014 +1200

Register confirm allow user to copy collection (Bug #1367939)

See bug for testing

Change-Id: Iddc02c10d163ad363b5c0acddd324393c8e00dbc
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "1.9_STABLE" branch: https://reviews.mahara.org/3701

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3701
Committed: http://gitorious.org/mahara/mahara/commit/87ddefc271675251138de306c533fb62a12ff8e2
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.9_STABLE

commit 87ddefc271675251138de306c533fb62a12ff8e2
Author: Robert Lyon <email address hidden>
Date: Thu Sep 11 10:47:05 2014 +1200

Register confirm allow user to copy collection (Bug #1367939)

See bug for testing

Change-Id: Iddc02c10d163ad363b5c0acddd324393c8e00dbc
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3702

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "1.7_STABLE" branch: https://reviews.mahara.org/3703

Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

Hi,

I couldn't replicate this bug. It worked perfectly when I tried.

The steps I tried were:

-Log in as admin
-Click Administration
-Institutions
-Add institution
-Added "test" institution
-Checked Registration Allowed
-Checked Confim Registration
-Submit
-Pages
-Create a page
-Filled in default fields with "test"
-Save
-Done
-Collections
-Add one
-Typed in name and description with "test"
-Next: Edit collection pages
-Checked the boxes of pages to add
-Add pages
-Done
-Home logo
-Administration
-Institutions
-Share
-Edit acces (key img)
-Advanced options drop down
-Check Allow copying
-OK
-Logout
-Register
-Entered first and last name and email
-Set institution to "my test one"
-Typed anything in registration reason
-Register
-Checked emails and clicked link in emails
-Sign in as Admin
-Click Approve
-Go back to emails and click the new link
-Brought up password change form, so changed password
-Click Submit
-Password saved successfully

Thanks,
Jinelle

Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

* Sorry, on 1.8

Revision history for this message
Robert Lyon (robertl-9) wrote :

Did you also check the 'Copy for new users' option when on step for 'Check Allow copying'?

The error is when it tries to copy the collection pages to the new user on user creation.

Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

Sorry I couldn't edit my previous comment, but yes I did .

 About to try on the 1.7 branch too.

Revision history for this message
Jinelle Foley-Barnes (jinelleb) wrote :

Hi,

The patch for 1.7 was successful as well.

Cheers,
Jinelle

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3703
Committed: http://gitorious.org/mahara/mahara/commit/8be59162bf87df0872d0f4ad0870fade0a4c8f5e
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.7_STABLE

commit 8be59162bf87df0872d0f4ad0870fade0a4c8f5e
Author: Robert Lyon <email address hidden>
Date: Thu Sep 11 10:47:05 2014 +1200

Register confirm allow user to copy collection (Bug #1367939)

See bug for testing

Change-Id: Iddc02c10d163ad363b5c0acddd324393c8e00dbc
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3702
Committed: http://gitorious.org/mahara/mahara/commit/3fdb6816585bd2159735e502fbbb2216a7498e77
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.8_STABLE

commit 3fdb6816585bd2159735e502fbbb2216a7498e77
Author: Robert Lyon <email address hidden>
Date: Thu Sep 11 10:47:05 2014 +1200

Register confirm allow user to copy collection (Bug #1367939)

See bug for testing

Change-Id: Iddc02c10d163ad363b5c0acddd324393c8e00dbc
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
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.