-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.5, 2.6.2, 2.7
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_25_STABLE, MOODLE_26_STABLE
-
MDL-45256-master -
When exporting a forum post containing an image tag (created with Atto), these warning are raised.
( ! ) Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: br line 1 and p in Entity, line: 1 in /home/fred/www/repositories/im/moodle/lib/portfoliolib.php on line 1232
|
Call Stack
|
# Time Memory Function Location
|
1 0.0005 317712 {main}( ) ../add.php:0
|
2 0.1859 32198224 portfolio_exporter->process_stage( ) ../add.php:265
|
3 0.2100 32201168 portfolio_exporter->process_stage( ) ../exporter.php:233
|
4 0.2187 32203008 portfolio_exporter->process_stage_package( ) ../exporter.php:227
|
5 0.2187 32203904 forum_portfolio_caller->prepare_package( ) ../exporter.php:459
|
6 0.2187 32204656 forum_portfolio_caller->prepare_post( ) ../locallib.php:215
|
7 0.2202 32297784 portfolio_rewrite_pluginfile_urls( ) ../locallib.php:299
|
8 0.2202 32299880 preg_replace_callback ( ) ../portfoliolib.php:1370
|
9 0.2202 32302096 partial->method( ) ../portfoliolib.php:1370
|
10 0.2202 32303672 call_user_func_array:{/home/fred/www/repositories/im/moodle/lib/moodlelib.php:9434} ( ) ../moodlelib.php:9434
|
11 0.2203 32303976 portfolio_rewrite_pluginfile_url_callback( ) ../moodlelib.php:9434
|
12 0.2203 32304232 loadXML ( ) ../portfoliolib.php:1232
|
|
( ! ) Warning: DOMDocument::loadXML(): Premature end of data in tag img line 1 in Entity, line: 1 in /home/fred/www/repositories/im/moodle/lib/portfoliolib.php on line 1232
|
Call Stack
|
# Time Memory Function Location
|
1 0.0005 317712 {main}( ) ../add.php:0
|
2 0.1859 32198224 portfolio_exporter->process_stage( ) ../add.php:265
|
3 0.2100 32201168 portfolio_exporter->process_stage( ) ../exporter.php:233
|
4 0.2187 32203008 portfolio_exporter->process_stage_package( ) ../exporter.php:227
|
5 0.2187 32203904 forum_portfolio_caller->prepare_package( ) ../exporter.php:459
|
6 0.2187 32204656 forum_portfolio_caller->prepare_post( ) ../locallib.php:215
|
7 0.2202 32297784 portfolio_rewrite_pluginfile_urls( ) ../locallib.php:299
|
8 0.2202 32299880 preg_replace_callback ( ) ../portfoliolib.php:1370
|
9 0.2202 32302096 partial->method( ) ../portfoliolib.php:1370
|
10 0.2202 32303672 call_user_func_array:{/home/fred/www/repositories/im/moodle/lib/moodlelib.php:9434} ( ) ../moodlelib.php:9434
|
11 0.2203 32303976 portfolio_rewrite_pluginfile_url_callback( ) ../moodlelib.php:9434
|
12 0.2203 32304232 loadXML ( ) ../portfoliolib.php:1232
|
After investigation, this seems broken because portfolio_rewrite_pluginfile_urls() expects IMG tags to be closed properly, which is not the case for HTML5 content. This issue is only highlighted now that Atto outputs HTML5 IMG tags.
Sample test:
<?php
|
define('CLI_SCRIPT', true);
|
require('config.php');
|
require_once($CFG->libdir . '/portfoliolib.php');
|
|
$html = '<p>Post and image.</p><p><img src="@@PLUGINFILE@@/1.png" alt="" width="902" height="245" role="presentation" style="vertical-align:text-bottom; margin: 0 .5em;" class="img-responsive"><br></p>';
|
portfolio_rewrite_pluginfile_urls($html, 1, 'test', 'test', 0, '', array(), $html);
|
- has a non-specific relationship to
-
MDL-21156 write a function to do the equivalent of file_rewrite_pluginfile_urls , but for portfolio to defer to export formats
-
- Closed
-
-
MDL-45316 Atto image plugin causes portfolio export to fail
-
- Closed
-
-
MDL-45322 Portfolio export of embedded images wrapped in a link
-
- Closed
-
- has been marked as being related by
-
MDL-45271 Portfolio export of embedded images as link
-
- Closed
-
-
MDL-45272 Portfolio export of files embedded in subfolders
-
- Closed
-
- Testing discovered
-
MDL-45340 PHP Unit does not consistently require global $CFG
-
- Closed
-
- will help resolve
-
MDLQA-6815 CLONE - A student can choose from a number of portfolios to export data to
-
- Passed
-