Gridstack layout conversion error during new user creation

Bug #1859118 reported by Ghada El-Zoghbi on 2020-01-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Status tracked in 20.04
19.10
High
Unassigned
20.04
High
Unassigned

Bug Description

Mahara: 19.10.1 (2019093009)
OS: Linux 18.04
DB: Postgres
Browser: FF

If an institution has pages to be copied to users upon creation and those pages are of the old format, an error is generated when trying to copy the page to the new user:

Jan 10 14:12:34 prod: 2020/01/10 14:12:34 [error] 227
#227: *389810 FastCGI sent in stderr: "PHP message: [WAR] 3e (lib/gridstacklayout.php:60) Undefined index: width
#012PHP message: Call stack (most recent first):
#012PHP message: * log_message(string(size 22), integer, true, true, string(size 37), integer) at /var/www/site/lib/errors.php:521
#012PHP message: * error(integer, string(size 22), string(size 37), integer, array(size 9)) at /var/www/site/lib/gridstacklayout.php:60
#012PHP message: * translate_to_new_layout(array(size 4)) at /var/www/site/lib/view.php:5929
#012PHP message: * View->copy_contents(object(View), array(size 0)) at /var/www/site/lib/view.php:458
#012PHP message: * View::create_from_template(array(size 5), string(size 5), string(size 5), false, false, array(size 0)) at /var/www/site/lib/collection.php:349
#012PHP message: * Collection::create_from_template(array(size 2), string(size 5), string(size 5), false) at /var/www/site/auth/user.php:1540
#012PHP message: * User->copy_collections(array(size 8), false) at /var/www/site/auth/user.php:1602
#012PHP message: * User->copy_institution_views_collections_to_new_member(string(size 16)) at /var/www/site/lib/institution.php:360
#012PHP message: * Institution->addUserAsMember(object(stdClass), null, null) at /var/www/site/lib/user.php:2622
#012PHP message: * create_user(object(stdClass), array(size 0), object(Institution), false, null, array(size 27)) at /var/www/site/admin/users/add.php:320
#012PHP message: * adduser_submit(object(Pieform), array(size 27)) at /var/www/site/lib/pieforms/pieform.php:546
#012PHP message: * Pieform->__construct(array(size 8)) at /var/www/site/lib/pieforms/pieform.php:168
#012PHP message: * Pieform::process(array(size 8)) at /var/www/site/lib/mahara.php:5432
#012PHP message: * pieform(array(size 8)) at /var/www/site/admin/users/add.php:156
#012PHP message:
#012PHP message: [WAR] 3e (lib/gridstacklayout.php:73) Undefined index: width
#012PHP message: Call stack (most recent first):
#012PHP message: * log_message(string(size 22), integer, true, true, string(size 37), integer) at /var/w

The issue is:

(lib/gridstacklayout.php:60) Undefined index: width <- translate_to_new_layout() doesn't find a relevant column in the row (i.e. that column is empty) and is trying to add the width of that column.

Ghada El-Zoghbi (ghada-z) wrote :

To replicate:

1. In a previous version of Mahara (18.10), create an institution named Inst1
2. Create an institution page to be copied for a user in Inst1.
3. Create the page with 3 rows and 3 columns.
4. Populate the page with artifacts in all rows and columns except for 1 column (i.e. the row 2 column 2 for example leave empty).
5. Upgrade Mahara to 19.10
6. Create a new user in the institution Inst1.

What happens:
- The above error will be generated

What should happen:
- The new user is created with the relevant Inst1 pages copied to their portfolio.

description: updated
summary: - Gridstack Layout Converstion Error During New User Creation
+ Gridstack layout conversion error during new user creation

Me and Ghada couldn't replicate this issue in any other instance

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

Other bug subscribers