Author:
nickdunn
Version:
0.4.1
Released:
21 April 2011
Category:
Field Types

New#4: Unable to view entry after updating a version (empty XML file)

In this case, the version contained a string that the extension appeared to have a hard time dealing with. This resulted in an empty XML file. The offending string (using Markdown Extra with Smarty Pants) contained the following (this is what I added to the textarea to trigger this behaviour):

<textarea class="brush:html"><!DOCTYPE html></textarea>

This resulted in the following error:

DOMDocument::load() [domdocument.load]: Document is empty in /Users/stephen/Sites/domain7/team/manifest/versions/255/2.xml, line: 1
/Users/stephen/Sites/domain7/team/extensions/entry_versions/lib/class.entryversionsmanager.php line 80

75      $files['filelist'] = array_reverse($files['filelist']);
76
77      
78      foreach($files['filelist'] as $file) {
79          $entry = new DomDocument();
80          $entry->load(MANIFEST . '/versions/' . $entry_id . '/' . $file);
81          $entries[] = $entry;            
82      }
83      
84      return $entries;

I was able to view the entry after copying content from another version into the file and changing the entry element version attribute value to the appropriate version number.

The problem does not occur when the offending string is wrapped in a CDATA section.

Please login to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details