External system tries to get the remote path even when it's not enabled.

Bug #1977671 reported by Christina Thee Roperto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

When trying to download a file, it needs to check if an external file system is enabled before it goes off to object storage like S3 to try to download the file.

Steps to reproduce:
1. Fresh install mahara
2. Install https://github.com/catalyst/mahara-module_aws and https://github.com/catalyst/mahara-module_objectfs
3. Configure the plugin with test S3 crendentials
4. Ensure that Enable transfer tasks is unticked (we installed the plugin but not using it yet).
5. Add this in config.php
$cfg->externalfilesystem = array(
   "includefilepath" => "module/objectfs/classes/s3_file_system.php",
   "class" => "module_objectfs\\s3_file_system"
);
6. Upload an image on the artefact (site/artefact/file/index.php)
7. Rotate the image. It would be broken and the only way to fix is to move back orientation to 0
8. If possible, check the logs and you will see it's trying to grab a file from S3

At the moment, when downloading/rotating a file where an external system plugin is installed, it doesn't check whether it's enabled or not. It only checks if there is an external system and then tries getting the remote path if it fails getting local path.

PS: this is very similar to https://bugs.launchpad.net/mahara/+bug/1975712 however in this case the external system is not enabled but it's still trying to download the image from S3. It should check first if it's enabled, if disabled then it should proceed to get local path.

I understand this is quite specific. Please let me know if you need more information from me.

I will create a patch for this :)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review
Changed in mahara:
status: New → In Progress
importance: Undecided → Medium
milestone: none → 22.10.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/12835
Committed: https://git.mahara.org/mahara/mahara/commit/d2cf1281030280bc78159609e8469ce01c505772
Submitter: "Robert Lyon <email address hidden>"
Branch: main

commit d2cf1281030280bc78159609e8469ce01c505772
Author: Christina Thee Roperto <email address hidden>
Date: Sun Jun 5 16:18:16 2022 +1000

Bug 1977671: checking if an external system is enabled

Change-Id: I91b741f62b3427ad2508ccb96138a27bbe7f996b

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Doris Tam (doristam)
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.