← Back to team overview

mahara-contributors team mailing list archive

[Bug 1700997] Re: View::create() throws an error if a layout has to be created on the fly

 

Hi Cecilia and Nicolas,


Cecilia, can you please take a look?

Nicolas: Can you please provide more information on how you create
portfolios from an external app? I'd be interested to know how you do
that and what sort of integration you have.

Thank you
Kristina


** Changed in: mahara
     Assignee: (unassigned) => Cecilia Vela Gurovic (ceciliavg)

-- 
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


References