[Mahara-contributors] [Bug 1953086] Re: Images in migrated page descriptions not displayed on a page

2021-12-02 Thread Scott Verbeek
I've come up with a bug fix for this. I still need to test and make it use 
Mahara functions create tests and document but I've got this atm.
```
loadHTML(htmlspecialchars_decode($content));
foreach ($dom->getElementsByTagName('img') as $tag) {
// Get the src attribute, if no attribute with the given qualifiedName 
is found an empty string is returned.
$imagesource = $tag->getAttribute('src');

// If it's empty then continue.
if(empty($imagesource)) {
continue;
}

// Make sure we only touch our links.
if (!strpos($imagesource, '/artefact/file/download.php?')) {
continue;
}

// If the source already contains a text parameter then skip.
parse_str(parse_url($imagesource, PHP_URL_QUERY), $result);
if(isset($result['text']) && !empty($result['text'])) {
continue;
}

// Now that we've got an image from our site append with =XYZ
log_debug("Found {$imagesource}");
$tag->setAttribute('src', "{$imagesource}={$biid}");
$dom->saveHTML();
}
// The DOMDocument adds some HTML tags which we don't want so get 
everything in the body.
$bodynode = $dom->getElementsByTagName('body')->item(0);
return 
implode(array_map([$bodynode->ownerDocument,"saveHTML"],iterator_to_array($bodynode->childNodes)));
}


$content = 'http://mahara.localhost/artefact/file/download.php?text=7embedded=1description=7;>';
$biid = 12346;

if ($content !== $newcontent = append_image_src_with_text_bi_id($content, 
$biid)) {
log_debug("Changed to {$newcontent}");
} else {
log_debug("Nothing changed");
}
```

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

Title:
  Images in migrated page descriptions not displayed on a page

Status in Mahara:
  Confirmed
Status in Mahara 21.04 series:
  Confirmed
Status in Mahara 21.10 series:
  Confirmed
Status in Mahara 22.04 series:
  Confirmed

Bug description:
  Upgrading from a site before Mahara 21.10 causes problems when images
  were added to the page description field. The URL is retained but the
  block ID is not added, therefore not displaying the image on the page.

  This was introduced in bug #1913386

  To replicate:

  1. Install fresh Mahara 20.04.
  2. Create a page and add an image to the page description. The URL will look 
something like 
http://DOMAIN/artefact/file/download.php?file=6=7=1=7
  3. Upgrade the site to 21.10 / main.
  4. View your page.

  Result:

  - Expected: The page description is now displayed in the block called 
'Description' and the image is shown. The URL should look something like:
  
http://DOMAIN/artefact/file/download.php?file=6=7=1=7=27
 with the = at the end to reference the block in which the image has been 
embedded.
  - Actual: the page description is now displayed in the block called 
'Description' but there is a broken image as the URL hasn't changed.

  Workaround for portfolios that can be edited:

  1. Edit the page.
  2. Click the 'Edit block' icon for the 'Description' block. You should see 
the image in the TinyMCE editor window.
  3. Save the block and the image will have the block reference added.

  This workaround is not possible for submitted pages. That's why we
  will need to provide an upgrade step.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1953086/+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 1953095] [NEW] 'Submitted host' info not displayed for pages submitted via LTI

2021-12-02 Thread Kristina Hoeppner
Public bug reported:

When a page is submitted to the LMS, e.g. Moodle, via LTI (1.1), the
'submitted host' info is not displayed in the notification. It looks
like this:

---
From: System

To: NAME

This is to confirm that you submitted the page "Page title" successfully
to the external host "" at 01 December 2021, 11:02pm.

If you have any questions about this submission, please contact the group 
administrator. 
---

Whereas for a collection the URL is displayed:

---
From: System

To: NAME

This is to confirm that you submitted the collection "Collection title"
successfully to the external host "https://LMS-DOMAIN; at 01 December
2021, 10:54pm.

If you have any questions about this submission, please contact the group 
administrator.
---

The collection has the 'submittedhost' line in the code:
https://git.mahara.org/mahara/mahara/-/blob/main/htdocs/lib/collection.php#L1808
whereas the view does not:
https://git.mahara.org/mahara/mahara/-/blob/main/htdocs/lib/view.php#L1759

It will need to be added.

While making this change, it would be good to update the language string
'messageexternal' and replace 'If you have any questions about this
submission, please contact the group administrator.' with 'If you have
any questions about this submission, please contact your course
administrator.'


To replicate:

1. Set up LTI 1.1 in an institution.
2. Set up 2 LTI activities in Moodle.
3. As student, submit a page to one activity and a collection to another.
4. Check the notifications. In both cases, the external host URL should be 
mentioned in the notification.

** Affects: mahara
 Importance: Medium
 Status: Confirmed

** Affects: mahara/21.10
 Importance: Medium
 Status: Confirmed

** Affects: mahara/22.04
 Importance: Medium
 Status: Confirmed


** Tags: bite-sized

** Also affects: mahara/22.04
   Importance: Medium
   Status: Confirmed

** Also affects: mahara/21.10
   Importance: Undecided
   Status: New

** Changed in: mahara/21.10
   Status: New => Confirmed

** Changed in: mahara/21.10
   Importance: Undecided => Medium

** Changed in: mahara/21.10
Milestone: None => 21.10.1

** Changed in: mahara/22.04
Milestone: None => 22.04.0

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

Title:
  'Submitted host' info not displayed for pages submitted via LTI

Status in Mahara:
  Confirmed
Status in Mahara 21.10 series:
  Confirmed
Status in Mahara 22.04 series:
  Confirmed

Bug description:
  When a page is submitted to the LMS, e.g. Moodle, via LTI (1.1), the
  'submitted host' info is not displayed in the notification. It looks
  like this:

  ---
  From: System

  To: NAME

  This is to confirm that you submitted the page "Page title"
  successfully to the external host "" at 01 December 2021, 11:02pm.

  If you have any questions about this submission, please contact the group 
administrator. 
  ---

  Whereas for a collection the URL is displayed:

  ---
  From: System

  To: NAME

  This is to confirm that you submitted the collection "Collection
  title" successfully to the external host "https://LMS-DOMAIN; at 01
  December 2021, 10:54pm.

  If you have any questions about this submission, please contact the group 
administrator.
  ---

  The collection has the 'submittedhost' line in the code:
  
https://git.mahara.org/mahara/mahara/-/blob/main/htdocs/lib/collection.php#L1808
  whereas the view does not:
  https://git.mahara.org/mahara/mahara/-/blob/main/htdocs/lib/view.php#L1759

  It will need to be added.

  While making this change, it would be good to update the language
  string 'messageexternal' and replace 'If you have any questions about
  this submission, please contact the group administrator.' with 'If you
  have any questions about this submission, please contact your course
  administrator.'


  To replicate:

  1. Set up LTI 1.1 in an institution.
  2. Set up 2 LTI activities in Moodle.
  3. As student, submit a page to one activity and a collection to another.
  4. Check the notifications. In both cases, the external host URL should be 
mentioned in the notification.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1953095/+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 1950695] A patch has been submitted for review

2021-12-02 Thread Mahara Bot
Patch for "main" branch: https://reviews.mahara.org/12285

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

Title:
  Class referenced with incorrect case

Status in Mahara:
  In Progress

Bug description:
  Using with PHPStan there are bunch of places where a class is called
  with incorrect camel case.

  We need to fix them up to correct case

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1950695/+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 1953086] [NEW] Images in migrated page descriptions not displayed on a page

2021-12-02 Thread Kristina Hoeppner
Public bug reported:

Upgrading from a site before Mahara 21.10 causes problems when images
were added to the page description field. The URL is retained but the
block ID is not added, therefore not displaying the image on the page.

This was introduced in bug #1913386

To replicate:

1. Install fresh Mahara 20.04.
2. Create a page and add an image to the page description. The URL will look 
something like 
http://DOMAIN/artefact/file/download.php?file=6=7=1=7
3. Upgrade the site to 21.10 / main.
4. View your page.

Result:

- Expected: The page description is now displayed in the block called 
'Description' and the image is shown. The URL should look something like:
http://DOMAIN/artefact/file/download.php?file=6=7=1=7=27
 with the = at the end to reference the block in which the image has been 
embedded.
- Actual: the page description is now displayed in the block called 
'Description' but there is a broken image as the URL hasn't changed.

Workaround for portfolios that can be edited:

1. Edit the page.
2. Click the 'Edit block' icon for the 'Description' block. You should see the 
image in the TinyMCE editor window.
3. Save the block and the image will have the block reference added.

This workaround is not possible for submitted pages. That's why we will
need to provide an upgrade step.

** Affects: mahara
 Importance: High
 Status: Confirmed

** Affects: mahara/21.04
 Importance: High
 Status: Confirmed

** Affects: mahara/21.10
 Importance: High
 Status: Confirmed

** Affects: mahara/22.04
 Importance: High
 Status: Confirmed

** Also affects: mahara/20.10
   Importance: Undecided
   Status: New

** Also affects: mahara/21.04
   Importance: Undecided
   Status: New

** Also affects: mahara/21.10
   Importance: Undecided
   Status: New

** Also affects: mahara/22.04
   Importance: High
   Status: Confirmed

** Changed in: mahara/21.10
   Status: New => Confirmed

** Changed in: mahara/21.04
   Status: New => Confirmed

** Changed in: mahara/20.10
   Status: New => Confirmed

** Changed in: mahara/21.10
   Importance: Undecided => High

** Changed in: mahara/21.04
   Importance: Undecided => High

** Changed in: mahara/20.10
   Importance: Undecided => High

** Changed in: mahara/22.04
Milestone: None => 22.04.0

** Changed in: mahara/21.10
Milestone: None => 21.10.1

** Changed in: mahara/21.04
Milestone: None => 21.04.3

** Changed in: mahara/20.10
Milestone: None => 20.10.4

** No longer affects: mahara/20.10

** Description changed:

  Upgrading from a site before Mahara 21.10 causes problems when images
  were added to the page description field. The URL is retained but the
  block ID is not added, therefore not displaying the image on the page.
+ 
+ This was introduced in bug #1913386
  
  To replicate:
  
  1. Install fresh Mahara 20.04.
  2. Create a page and add an image to the page description. The URL will look 
something like 
http://DOMAIN/artefact/file/download.php?file=6=7=1=7
  3. Upgrade the site to 21.10 / main.
  4. View your page.
  
  Result:
  
- - Expected: The page description is now displayed in the block called 
'Description' and the image is shown. The URL should look something like: 
+ - Expected: The page description is now displayed in the block called 
'Description' and the image is shown. The URL should look something like:
  
http://DOMAIN/artefact/file/download.php?file=6=7=1=7=27
 with the = at the end to reference the block in which the image has been 
embedded.
  - Actual: the page description is now displayed in the block called 
'Description' but there is a broken image as the URL hasn't changed.
  
  Workaround for portfolios that can be edited:
  
  1. Edit the page.
  2. Click the 'Edit block' icon for the 'Description' block. You should see 
the image in the TinyMCE editor window.
  3. Save the block and the image will have the block reference added.
  
  This workaround is not possible for submitted pages. That's why we will
  need to provide an upgrade step.

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

Title:
  Images in migrated page descriptions not displayed on a page

Status in Mahara:
  Confirmed
Status in Mahara 21.04 series:
  Confirmed
Status in Mahara 21.10 series:
  Confirmed
Status in Mahara 22.04 series:
  Confirmed

Bug description:
  Upgrading from a site before Mahara 21.10 causes problems when images
  were added to the page description field. The URL is retained but the
  block ID is not added, therefore not displaying the image on the page.

  This was introduced in bug #1913386

  To replicate:

  1. Install fresh Mahara 20.04.
  2. Create a page and add an image to the page description. The URL will look 
something like 
http://DOMAIN/artefact/file/download.php?file=6=7=1=7
  3. Upgrade 

[Mahara-contributors] [Bug 1952540] A patch has been submitted for review

2021-12-02 Thread Mahara Bot
Patch for "main" branch: https://reviews.mahara.org/12284

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

Title:
  Issues with 'Current submissions' and 'Archived submissions'

Status in Mahara:
  Confirmed
Status in Mahara 21.10 series:
  Confirmed
Status in Mahara 22.04 series:
  Confirmed

Bug description:
  There are a couple of issues with the submission reporting screens in
  Admin menu -> Groups -> Current / Archived submissions

  1. On the tab 'Current submissions', the column header 'Submitted on'
  can be clicked but the table is not actually sorted according to the
  date.

  To replicate:

  1. Submit a few portfolios at different times or manipulate the database to 
get different dates.
  2. Sort the column 'Submitted on'.

  Results:
  - Expected: The results are sorted in ascending or descending order.
  - Actual: Nothing happens.

  2. On the tab 'Current submissions', the CSV file contains the column
  'archivectime' but that is empty because the submission hasn't been
  archived yet. Instead, it should display the submitted time in a
  human-readable time format like we use in the 'Account details' report
  for example so that the column can be sorted in the CSV file.

  3. On the tab 'Current submissions', the CSV file should not contain
  the columns 'filetitle', 'filepath', and 'filename' because they are
  irrelevant for this report.

  4. On the tab 'Archived submissions', the CSV file contains the column
  'archivectime' that contains data. It is the Unix timestamp though
  that is hard to read. Instead, it should display the timestamp in a
  human-readable yet also sortable fashion like in the 'Account details'
  report for the 'login date' when exported as CSV.

  5. On the tab 'Archived submissions', the 'ID' help text has been
  mislabeled. It should read 'The ID of the archive file on the server.
  That allows you to match it to the file mentioned in the CSV
  download.' However, right now, it takes the help text for the ID field
  on the 'Current submissions' screen.

  6. On both tabs when logged in as institution admin, the usernames are
  not linked to their /admin/users/edit.php?id= page. This is the case
  for site admins though.

  Combining the two menu items into one is taken care of in bug
  #1949421.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1952540/+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 1686866] Re: Mark plan tasks as completed directly on portfolio page

2021-12-02 Thread Alexander Del Ponte
Functionality is provided in the newer Mahara versions.

** Changed in: mahara
   Status: Confirmed => Fix Released

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

Title:
  Mark plan tasks as completed directly on portfolio page

Status in Mahara:
  Fix Released

Bug description:
  When you want to mark a plan's task as complete, you need to go to
  Content -> Plans -> Select the plan -> Select the task -> Flip the
  switch. It would be better if you could mark a task as completed
  directly from your portfolio page by clicking the icon and receiving a
  confirmation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1686866/+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 1280065] Re: wishlist: complete tasks from the plan - task list

2021-12-02 Thread Alexander Del Ponte
Functionality is provided in the newer Mahara versions.

** Changed in: mahara
   Status: Confirmed => Fix Released

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

Title:
  wishlist: complete tasks from the plan - task list

Status in Mahara:
  Fix Released

Bug description:
  Mahara 1.8

  A user asked if they can mark a planning task completed from the page
  that lists the tasks (rather than having to edit the task and check
  complete and click save).

  They wanted to click on the red icon to mark it completed. By
  extension they could click the tick to turn it back to un-completed.

  This would be a usability enhancement wish.

  Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1280065/+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