Embedly export format incorrect (stdClass vs array)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Dianne Tennent | ||
20.10 |
Fix Released
|
Medium
|
Unassigned | ||
21.04 |
Fix Released
|
Medium
|
Unassigned | ||
21.10 |
Fix Released
|
Medium
|
Unassigned | ||
22.04 |
Fix Released
|
Medium
|
Dianne Tennent |
Bug Description
When you export a page that has external embedly content (example below), and then import it, the block's $configdata[
This then throws an exception when being displayed/processed e.g. /blocktype/
1. The data is not being exported correctly (I'm new to Mahara, so don't know where that happens)
2. The data isn't being correctly handled in line 202.
As a work-around we could cast the embed element as an array
202: $configdata[
To reproduce:
1. Create a page
2. Add "External media" content type
3. Paste in the following: <a class="
4. Save
5. Check the database that this has been saved as an array. SELECT * FROM block_instance WHERE configdata LIKE '%embedly%'; If you know the id you can search for that. The result should be something like:
146 | externalvideo | Penn design embedly-card | a:8:{s:
| 40 | 0 | 0 | 0
where "embed";a:4
6. Now export this page (Manage -> Export -> Just some of my pages) and select the page you just created.
7. Now import the exported page
8. View imported page. You will get the following error.
[WAR] ad (lib/errors.
Mahara: 21.10
Using Mahara docker in local dev with default set up for 21.10
Patch for "main" branch: https:/ /reviews. mahara. org/12440