Tidy up the artefact attachments_from_id_list() function

Bug #1867822 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Lisa Seeto

Bug Description

There are a bunch of places that call this function and then straight after do a loop to add a file icon

We should do the adding of the file icon within the call to attachments_from_id_list()
eg:

htdocs/artefact/resume/lib.php:2088
htdocs/artefact/blog/lib.php:1051
htdocs/artefact/comment/lib.php:511
htdocs/artefact/internal/notes.php:167
htdocs/artefact/internal/notes.json.php:167

Also there are a bunch of places where we don't even call the function and just duplicate it:

htdocs/artefact/resume/composite.json.php:
htdocs/artefact/resume/lib.php
htdocs/artefact/blog/blocktype/recentposts/lib.php:

These should be fixed to use the function we already have

Tags: refactoring
Robert Lyon (robertl-9)
Changed in mahara:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → Lisa Seeto (lisaseeto)
tags: added: code-cleanup
Lisa Seeto (lisaseeto)
Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10954

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10954
Committed: https://git.mahara.org/mahara/mahara/commit/9cecf19dcef8e7146a0ca997a015d6016eb44a06
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 9cecf19dcef8e7146a0ca997a015d6016eb44a06
Author: Lisa Seeto <email address hidden>
Date: Mon May 4 10:52:45 2020 +1200

Bug 1867822: Tidy up the artefact attachments_from_id_list() function

- alter files to use attachments_from_id_list()
- alter attachments_from_id_list func params

Change-Id: I32b26586deb2f2a1b6a624f2c7afc4520a1a57ff
Signed-off-by: Lisa Seeto <email address hidden>

Revision history for this message
Robert Lyon (robertl-9) wrote :

This tidying up of code actually fixed a couple of errors where the image attachment icon was not showing for recentposts / notes when view another's page as normal user

Changed in mahara:
milestone: none → 20.10.0
status: In Progress → Fix Committed
importance: Medium → High
Lisa Seeto (lisaseeto)
tags: added: refactoring
removed: code-cleanup
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.