mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #31828
[Bug 1512894] Re: Leap2A import isn't populating the artefact_file_embedded table for most things
Reposting this comment, which I originally made on Bug 1520328:
In fixing this, it should be noted that you also need to test for
whether the embedded image is visible to other users:
1. Share the page with another user (or with "Public" or "Registered users")
2. View the page as another user and see if the image displays properly.
A user's permission to view a page is currently tracked via several
different tables, at least one of which must have an appropriate record:
- artefact_attachment: For classic "attachments", like those on notes, blog entries, and comments
- view_artefact: For artefacts displayed directly by selection in a block (e.g. the image block)
- artefact_file_embedded: For images embedded in another artefact's rich text fields
The import process must populate any of these that are appropriate, in
order for it to work correctly.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1512894
Title:
Leap2A import isn't populating the artefact_file_embedded table for
most things
Status in Mahara:
Confirmed
Bug description:
The artefact_file_embedded table was added with the TinyMCE image
picker button. Its purpose is to store the embed relationship, so that
it can be checked for permission purposes (I have permission to view
this thing; do I then have permission to view this other thing?)
Currently, it's somewhat redundant for some purposes, because this
relationship is also tracked in the view_artefact &
artefact_attachment tables, as well as a couple of other places. But
artefact_file_embedded is unique in that it's abstract enough to cover
cases that aren't covered by the other tables, such as view
descriptions and forum posts.
So, for best practice, we should always be populating this table
whenever we embed an image into a text field. And we do this pretty
much everywhere *except* in Leap2a imports.
For Leap2a imports, artefact_file_embedded is populated for images in
view descriptions, but not for images embedded in anything else: blog
entries, resume fields, text blocks, notes, etc.
We should re-use the
EmbeddedImage->rewrite_embedded_image_urls_from_import() method, for
all imports. By my analysis, it can probably go in (or maybe replace)
the call to ImportLeap->fix_artefact_references() in
ImportLeap->do_import()
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1512894/+subscriptions
References