[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-10-24 Thread Cecilia Vela Gurovic
** Changed in: mahara/18.10
   Status: Fix Committed => Fix Released

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Fix Released
Status in Mahara 17.10 series:
  Fix Released
Status in Mahara 18.04 series:
  Fix Released
Status in Mahara 18.10 series:
  Fix Released

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-04-05 Thread Cecilia Vela Gurovic
** Changed in: mahara/17.10
   Status: Fix Committed => Fix Released

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Fix Released
Status in Mahara 17.10 series:
  Fix Released
Status in Mahara 18.04 series:
  Fix Released
Status in Mahara 18.10 series:
  Fix Committed

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-04-05 Thread Robert Lyon
** Changed in: mahara/18.04
   Status: Fix Committed => Fix Released

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Fix Released
Status in Mahara 17.10 series:
  Fix Committed
Status in Mahara 18.04 series:
  Fix Released
Status in Mahara 18.10 series:
  Fix Committed

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-22 Thread Alexander Del Ponte
Hi Kristina and Robert,

I had a look at the code and the warning is caused by trying to access
an object property on an array as the error message implies.

For my issue everything is working fine when supressing the on screen
display of warning messages, but I wonder, if the overall functionality
of this code part will be given.

When there is an 'id' field in the array, $v['id'] will have a value,
but $v->id won't and the loop will just continue with the next item.

However, thank you very much for your fast response and solution - Many 
greetings
Alex

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Fix Committed
Status in Mahara 17.10 series:
  Fix Committed
Status in Mahara 18.04 series:
  Fix Committed
Status in Mahara 18.10 series:
  Fix Committed

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-21 Thread Robert Lyon
** Changed in: mahara/18.04
   Status: Confirmed => Fix Committed

** Changed in: mahara/17.10
   Status: Confirmed => Fix Committed

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Fix Committed
Status in Mahara 17.10 series:
  Fix Committed
Status in Mahara 18.04 series:
  Fix Committed
Status in Mahara 18.10 series:
  Fix Committed

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-20 Thread Robert Lyon
Steps to test:

1) Make a group that is 'Open' and is also 'Publicly viewable group'
2) make some pages in the group and add all of them to a collection
3) share the collection to the group and to registered users

4) find the ID of the collection and then make sure there is no view
with same ID in database

Visit the group's 'Pages and collections' tab as a logged in user that
is not a member of the group

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Confirmed
Status in Mahara 17.10 series:
  Confirmed
Status in Mahara 18.04 series:
  Confirmed
Status in Mahara 18.10 series:
  In Progress

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-19 Thread mafen
This also affects Mahara 17.10

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Confirmed
Status in Mahara 18.04 series:
  Confirmed
Status in Mahara 18.10 series:
  In Progress

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-19 Thread Alexander Del Ponte
Hi Kristina and Robert,

functionally the problem is resolved, the portfolios now are displayed.
So the error is gone but is replaced with a warning now which is no problem, 
cause in our prod environment warning are supressed.

[WAR] d5 (lib/view.php:5466) Trying to get property of non-object
Call stack (most recent first):

log_message("Trying to get property of non-object", 8, true, true, 
"/var/www/mahara/master/htdocs/lib/view.php", 5466) at 
/var/www/mahara/master/htdocs/lib/errors.php:521
error(8, "Trying to get property of non-object", 
"/var/www/mahara/master/htdocs/lib/view.php", 5466, array(size 13)) at 
/var/www/mahara/master/htdocs/lib/view.php:5466
View::get_extra_view_info(array(size 4), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

Thanks and greetings
Alex

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Confirmed
Status in Mahara 18.04 series:
  Confirmed
Status in Mahara 18.10 series:
  In Progress

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-18 Thread Robert Lyon
** Changed in: mahara/18.10
 Assignee: (unassigned) => Robert Lyon (robertl-9)

** Changed in: mahara/18.04
 Assignee: (unassigned) => Robert Lyon (robertl-9)

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  Confirmed
Status in Mahara 18.04 series:
  Confirmed
Status in Mahara 18.10 series:
  In Progress

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp


[Mahara-contributors] [Bug 1749402] Re: Views and collection list (in group) throws MySQL error

2018-03-08 Thread Robert Lyon
The problem here stems from the htdocs/view/groupviews.php file around
these lines:

 $data = View::view_search(null, null, (object) array('group' => $group->id), 
null, $limit, $offset,
  true, null, null, false, null, null,
  null, null, true);
 $viewdata = $data->data;
 View::get_extra_view_info($viewdata, false);
 View::get_extra_collection_info($viewdata, false, 'collid');

The issue is that $viewdata is an array of both collection and view data
so when it gets to

 View::get_extra_view_info($viewdata, false);

it treats the collection 'id' like it is a view 'id' and if the
collection has an 'id' that doesn't exist as an 'id' in the view table
we get this error

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

Title:
  Views and collection list (in group) throws MySQL error

Status in Mahara:
  New

Bug description:
  If a normal group member tries to visit views and collections of the
  group, following warning/error is thrown under some conditions which
  are mentioned below:

  SQL:
  [WAR] 93 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1452: 
Cannot add or update a child row: a foreign key constraint fails 
("dp-dev-master-ep"."view_rows_columns", CONSTRAINT "viewrowscolu_vie_fk" 
FOREIGN KEY ("view") REFERENCES "view" ("id"))] in EXECUTE("INSERT INTO 
"view_rows_columns" ("view", "row", "columns") VALUES ('46', '1', '3')")Command 
was: INSERT INTO "view_rows_columns" ("view", "row", "columns") VALUES (?, ?, 
?) and values was (view:46,row:1,columns:3)

  PHP:
  Call stack (most recent first):
  log_message("Failed to get a recordset: mysqli error: [1452: Ca...", 8, true, 
true) at /var/www/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: mysqli error: [1452: Ca...") at 
/var/www/mahara/master/htdocs/lib/errors.php:859
  SQLException->__construct("Failed to get a recordset: mysqli error: [1452: 
Ca...") at /var/www/mahara/master/htdocs/lib/dml.php:1105
  insert_record("view_rows_columns", object(stdClass), false, false) at 
/var/www/mahara/master/htdocs/lib/dml.php:1192
  ensure_record_exists("view_rows_columns", object(stdClass), object(stdClass)) 
at /var/www/mahara/master/htdocs/lib/view.php:356
  View->__construct(0array(size 25)) at 
/var/www/mahara/master/htdocs/lib/view.php:5581
  View::get_extra_view_info(array(size 2), false) at 
/var/www/mahara/master/htdocs/view/groupviews.php:52

  This happens if the group views and collections are readonly to
  members, a group collection exisits with at least one view inside and
  in the DB there is no view which has the same id as this collection.

  I didn't went too deep inside the code, but it seems that this issue
  is somehow connected to the bug #1514608.

  It further seems that Mahara interprets a collection as a view trying
  to get/set view related data using a collection id to avoid having no
  DB entry in table view_rows_columns for this erroneously supposed view
  so the actually error should be found in functions calling this code
  areas (get_extra_view_info).

  Reproduce error:
  Create a group in which views and collections are only editable by others 
that normal group members.
  Create a view and a collection inside this group and assign the view to the 
collection.
  Make sure, that in the DB there are no entries referring to a view which has 
the same id as the above created collection (e. g. by deleting a possibly 
existing view with this id inside Mahara).
  As a normal group member call the tab views and collection of the group.

  Greetings
  Alex

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

___
Mailing list: https://launchpad.net/~mahara-contributors
Post to : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp