← Back to team overview

mahara-contributors team mailing list archive

[Bug 1990981] Re: Unable to copy pages or collections into group

 

Steps to reproduce the "missing group info" (part 2 of the patch)

1) Log in as student on demo.mahara.org
2) Go to "Engage" / "Groups"
3) Select "Human Computer Interaction 101"
4) Go to "Pages and collections"
5) Click "Copy"
6) Go to page 2 of the listing
7) Note that the group-banner on top is already gone and every "copy" will go to "student"s private area, not the group
8) Add "&group=2" to the URL on page 2 and hit enter. The group-banner reappears and "Copy" will actually copy to the group.


Steps to reproduce the integer group type (part 1 of the patch)

I'm not sure which artefact-type triggers this error, but I found this
in our logfiles:

2022/09/26 11:17:30 [error] 3183590#3183590: *446305 FastCGI sent in
stderr: "PHP message: [WAR] 37 (lib/view.php:3841) get_class() expects
parameter 1 to be object, int givenPHP message: Call stack (most recent
first):PHP message:   * log_message(string(size 55), integer, true,
true, string(size 21), integer) at /var/www/lib/errors.php:515PHP
message:   * error(integer, string(size 55), string(size 21), integer,
array(size 19)) at /var/www/lib/view.php:3841PHP message:   *
View::get_artefactchooser_artefacts(array(size 2), null, integer, null,
true) at /var/www/blocktype/lib.php:2336PHP message:   *
BlockInstance->rebuild_artefact_list() at
/var/www/blocktype/lib.php:2275PHP message:   * BlockInstance->commit()
at /var/www/blocktype/lib.php:1468PHP message:   *
BlockInstance->instance_config_store(object(Pieform), array(size 4)) at
/var/www/lib/pieforms/pieform.php:577PHP message:   *
Pieform->__construct(array(size 15)) at /var/www/lib/mahara.php:5733PHP
message:   * pieform_instance(array(size 15)) at
/var/www/blocktype/lib.php:2015PHP message:   *
BlockInstance->build_configure_form() at /var/www/view/blocks.php:84PHP
message: PHP message: [WAR] 37 (lib/errors.php:853) Failed to get a
recordset: mysqli error: [0: ] in EXECUTE("SELECT DISTINCT agg.* FROM
(SELECT a.id, a.id AS b FROM "artefact" a  LEFT JOIN "tag" t ON
t.resourcetype = 'artefact' AND a.id = t.resourceid PHP message: [WAR]
37 (lib/errors.php:853)             LEFT OUTER JOIN (PHP message: [WAR]
37 (lib/errors.php:853)                 SELECTPHP message: [WAR] 37
(lib/errors.php:853)                     r.artefact, r.can_view,
r.can_edit, m.groupPHP message: [WAR] 37 (lib/errors.php:853)
FROMPHP message: [WAR] 37 (lib/errors.php:853)
"group_member" mPHP message: [WAR] 37 (lib/errors.php:853)
JOIN "artefact" aa ON aa.group = m.groupPHP message: [WAR] 37
(lib/errors.php:853)                     JOIN "artefact_access_role" r
ON aa.id = r.artefact AND r.role = m.rolePHP message: [WAR] 37 (lib/erro

There's also another patch in the current development-version of mahara
that adresses this problem. Even more elegant than my solution. See bug
#1979921

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1990981

Title:
  Unable to copy pages or collections into group

Status in Mahara:
  Incomplete

Bug description:
  When trying to copy a page or collection into a group, the group
  information gets lost when moving away from the first page of
  candidates. Collections will be copied, but into the personal area,
  not into the desired group.

  Debugging shows line 6504 in lib/view.php to be the culprit. Adding
  params only when there are none makes no sense. Removing the negation
  seems to solve the problem. Please find patch included.

  First part of patch solves a type mismatch error related to copying pages with certain artefacts.
  Second part solves this actual bug.

  Mahara version 22.04.2
  Ubuntu 20.04
  MariaDB 10.3

  Reproducible on current demo.mahara.org

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



References