Public bug reported:

We have an external app that creates Views in Mahara. While creating
Views it creates the corresponding layout if needed. However, an error
was alwasys thrown at lib/view.php:334 when calling
ensure_record_exists('view_rows_columns', $vrc, $vrc);. As the $vrc
record is created, the DB insert fails because $vrc->view is null, as
the view is not (yet) created.

The attached patch fixes this by ensuring the view is saved in the DB
(and thus haves an ID) before attempting to create the $vrc object.

Mahara version : 17.04.2
OS : GNU/Linux Debian 8.8
DB : MySQL 5.5
PHP : 5.6

** Affects: mahara
     Importance: Undecided
         Status: New

** Patch added: "patch fixing the problem"
   
https://bugs.launchpad.net/bugs/1700997/+attachment/4904665/+files/mahara_17.04_view_create.patch

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1700997

Title:
  View::create() throws an error if a layout has to be created on the
  fly

Status in Mahara:
  New

Bug description:
  We have an external app that creates Views in Mahara. While creating
  Views it creates the corresponding layout if needed. However, an error
  was alwasys thrown at lib/view.php:334 when calling
  ensure_record_exists('view_rows_columns', $vrc, $vrc);. As the $vrc
  record is created, the DB insert fails because $vrc->view is null, as
  the view is not (yet) created.

  The attached patch fixes this by ensuring the view is saved in the DB
  (and thus haves an ID) before attempting to create the $vrc object.

  Mahara version : 17.04.2
  OS : GNU/Linux Debian 8.8
  DB : MySQL 5.5
  PHP : 5.6

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1700997/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to