Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: SCORM attachment link error #4144

Closed

Conversation

edalex-yinzi
Copy link
Contributor

@edalex-yinzi edalex-yinzi commented May 19, 2022

Checklist
Description of change

Fix missing attachment links for unzip files.

The issue is in staging folder all unzip files are not transferred properly and still stay in the folder _uploads which will be removed before moving to institution folder.

#3465

Before:

Upload a zip file:
166291304931a5d3823c1514bed35ac5

Unzip:
f2202021b2a9a5f3d9751e12d428351b

Save:
02adc19cd9e4bde824e0b284016e1653

After fix

Upload zip file:
image

Unzip:
image

Save:
image

@edalex-yinzi edalex-yinzi marked this pull request as ready for review May 20, 2022 03:37
@edalex-ian edalex-ian changed the title fix: attachment link error fix: SCORM attachment link error May 23, 2022
commitUnzipPaths.foreach(p => stagingContext.moveFile(p._1, fa.getFilename))
val UPLOADS_FOLDER = FileUploadState.UPLOADS_FOLDER
val newName = fa.getFilename.replaceFirst(s"^$UPLOADS_FOLDER/.*/", "")
stagingContext.moveFile(fa.getFilename, WebFileUploads.zipPath(newName))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some comments here to describe why you do this ?

@edalex-ian
Copy link
Member

I imagine two things:

  1. This used to work, and hence why it was raised as a bug only recently; and
  2. This probably came about as a result of the rework of the upload control.

With that in mind, perhaps we should look back to how it used to be done, starting with the following references to when the change was made:

Keep in mind that since those the purscript code was replaced with typescript and the scala updated as needed.

@edalex-yinzi
Copy link
Contributor Author

edalex-yinzi commented May 30, 2022

I found this bug was first mentioned in 2018 but I am confused since it said it was fixed. #576
I tested it locally and 6.6 is fine but the bug back again in 2018.2

@edalex-yinzi
Copy link
Contributor Author

Could it be because that change was not merged to develop? I can't find that commit history in develop branch locally.

@PenghaiZhang
Copy link
Contributor

Could it be because that change was not merged to develop? I can't find that commit history in develop branch locally.

If you open any file involved in that commit, can you see the changes ?

@PenghaiZhang
Copy link
Contributor

Could it be because that change was not merged to develop? I can't find that commit history in develop branch locally.

You can also try to cherry pick that commit in your working branch and see if it can fix the issue.

@PenghaiZhang
Copy link
Contributor

That commit is not a merge commit. I think it was pushed to stable-6.6 directly.

@edalex-ian
Copy link
Member

Work on this continues elsewhere, closing PR.

@edalex-ian edalex-ian closed this Jun 17, 2022
@edalex-yinzi edalex-yinzi deleted the fix/attachment_link branch June 20, 2023 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants