Creating a new institution with minimal info fails to save

Bug #1828141 reported by Robert Lyon on 2019-05-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Unassigned
18.04
High
Unassigned
18.10
High
Unassigned
19.04
High
Unassigned
19.10
High
Unassigned

Bug Description

When we do something like:

    $name = 'My new institution';
    $institution = institution_generate_name($name);
    $newinstitution = new Institution();
    $newinstitution->initialise($institution, $name);
    $newinstitution->commit();

It should create us a new institution - but instead we get an sql error complaining that the 'tags' column is not an integer

Steven (stevens-q) wrote :

TITLE: Creating a new institution with minimal info fails to save

BUG SUMMARY: This bug has something to do with a larger piece of functionality (SAML login) This code basically creates an Institution when a user browses to the home page - multiple browses to home page = multiple Institution created with an alpha character amended to the short name.

When we do something like:

    $name = 'My new institution';
    $institution = institution_generate_name($name);
    $newinstitution = new Institution();
    $newinstitution->initialise($institution, $name);
    $newinstitution->commit();

It should create us a new institution - but instead we get an sql error complaining that the 'tags' column is not an integer
==============================================

Commit hash:
Environment tested: Master
Browser tested: Chrome
Theme used: Raw | Default raw | Ocean | Modern | Primary school

PRECONDITIONS:
------------------------
1) Add the following code to the index.php file found in the htdocs folder.
     a) Add the code just above the if user is logged in function (line 29)
     b) code to add is
    $name = 'My new institution';
    $institution = institution_generate_name($name);
    $newinstitution = new Institution();
    $newinstitution->initialise($institution, $name);
    $newinstitution->commit();
2) Site admin user is Logged in to site

TEST STEPS:
------------------------
1) Browse to the home page
2) Refresh the home page
3) Browse to Admin menu > Institutions > Settings
4) Verify that an Institution named "My new institution" and a short name of "mynewinstitution" has been created ✔
5) Verify that an Institution named "My new institution" and a short name of "mynewinstitutiona" has been created ✔

Catalyst QA ✔

NOTE: Remove the code from the index.php file - you don't want a million Institutions to be created

Changed in mahara:
status: New → In Progress
importance: Undecided → High
milestone: none → 19.10.0

Reviewed: https://reviews.mahara.org/9978
Committed: https://git.mahara.org/mahara/mahara/commit/e3171960e78e701446eaf15a6dc548e5ebb5c8f0
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit e3171960e78e701446eaf15a6dc548e5ebb5c8f0
Author: Robert Lyon <email address hidden>
Date: Wed May 8 14:15:32 2019 +1200

Bug 1828141: Create a new institution correctly

Need the default settings be interger rather than true/false

behatnotneeded

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

Reviewed: https://reviews.mahara.org/9998
Committed: https://git.mahara.org/mahara/mahara/commit/883bb2cbc9790eaf2ab2c54b8687685c555f64ca
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 19.04_STABLE

commit 883bb2cbc9790eaf2ab2c54b8687685c555f64ca
Author: Robert Lyon <email address hidden>
Date: Wed May 8 14:15:32 2019 +1200

Bug 1828141: Create a new institution correctly

Need the default settings be interger rather than true/false

behatnotneeded

Change-Id: I65a032e3a5b1cf363b6f0ebcc6c7f5a3b30c2f34
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e3171960e78e701446eaf15a6dc548e5ebb5c8f0)

Reviewed: https://reviews.mahara.org/9999
Committed: https://git.mahara.org/mahara/mahara/commit/366c905b20ea7f41957178f46cc70070925033d0
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 18.10_STABLE

commit 366c905b20ea7f41957178f46cc70070925033d0
Author: Robert Lyon <email address hidden>
Date: Wed May 8 14:15:32 2019 +1200

Bug 1828141: Create a new institution correctly

Need the default settings be interger rather than true/false

behatnotneeded

Change-Id: I65a032e3a5b1cf363b6f0ebcc6c7f5a3b30c2f34
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e3171960e78e701446eaf15a6dc548e5ebb5c8f0)
(cherry picked from commit 883bb2cbc9790eaf2ab2c54b8687685c555f64ca)

Reviewed: https://reviews.mahara.org/10000
Committed: https://git.mahara.org/mahara/mahara/commit/3aee5e6277c5b112dd0d39000c7260ccd9f906e5
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 18.04_STABLE

commit 3aee5e6277c5b112dd0d39000c7260ccd9f906e5
Author: Robert Lyon <email address hidden>
Date: Wed May 8 14:15:32 2019 +1200

Bug 1828141: Create a new institution correctly

Need the default settings be interger rather than true/false

behatnotneeded

Change-Id: I65a032e3a5b1cf363b6f0ebcc6c7f5a3b30c2f34
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e3171960e78e701446eaf15a6dc548e5ebb5c8f0)
(cherry picked from commit 883bb2cbc9790eaf2ab2c54b8687685c555f64ca)

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

Other bug subscribers