Search

There probably is an unencoded ampersand (&) or similar in the HTML, so it is invalid XML and DOMDocument::loadHTML() chokes on it. You could run $context['output'] through tidy or similar, or use Symphony’s proprietary XML class.

pretty strange

This is kind of a bug in that Symphony isn’t encoding ampersands when it renders the navigation groups. Technically it’s a Symphony core bug, but I don’t really like the way that this extension parses the backend HTML anyway (since we’re using the HTML5 doctype, and there’s nothing to say that HTML needs to be parsable as XML), so ideally this extension would evolve away from this method.

@Nick

I don’t really like the way that this extension parses the backend HTML anyway (since we’re using the HTML5 doctype, and there’s nothing to say that HTML needs to be parsable as XML), so ideally this extension would evolve away from this method.

Technically, neither do I. I looked today at the delegates for Blueprints Sections but didn’t find something similar to Blueprints->Pages @delegate AppendPageContent. If there is a delegate with sort of the same functionality, I would rewrite the DOMElement parts of this extension.

I wanted to edit the generated form, the same (or close) way to Page editing.

Agreed. Could the checkbox be added with JavaScript instead?

Maybe we need a delegate like the one just added to the Authors page.

Could the checkbox be added with JavaScript instead?

That’s a hack, isn’t it? Using a delegate might be more appropriate.

Yes, both parsing the DOM with PHP and with JavaScript are equally hacky, although the latter is more unobtrusive and arguably less brittle. A delegate request would be the right way to go here. Can we get one in for 2.2?

This extension also needs to remove nodes through XMLElement class, otherwise, DOMDocument to rescue us.

@rainerborene

I made a request for a delegate to manipulate the $form structure. It will be available in 2.2.1 and then the extension can be updated through XMLElement.

A minor issue using the latest version with 2.2, the title of the single entry doesn't read as the section name, it reverts to the first form field content. To resolve this requires a change to the extension.driver.php on line 140 from:

from

$h2 = $xpath->query("/html/body/form/h2")->item(0);

to

$h2 = $xpath->query("/html/body/div/div[2]/h2")->item(0);

Si.

I'm currently getting this error:

DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: no name in Entity, line: 817 C:xampphtdocssitedevextensionsstatic_sectionextension.driver.php line 100

95          }
96      }
97
98      private function appendPreferences($context){
99          if ($this->_callback['driver'] == 'blueprintssections' && in_array($this->_callback['context'][0], array('edit', 'new'))){
100             $dom = @DOMDocument::loadHTML($context['output']);
101             $xpath = new DOMXPath($dom);
102
103             $meta = $xpath->query("//input[@name='meta[hidden]']")->item(0);
104

I have no idea at what stage of development this went wrong, but I can't access any sections (even ones that haven't had the checkbox ticked) without this error popping up. Can anyone help?

Running Symphony 2.2 and the latest Static Section (1.5)

That's copied from some posts above.

There probably is an unencoded ampersand (&) or similar in the HTML, so it is invalid XML and DOMDocument::loadHTML() chokes on it. You could run $context['output'] through tidy or similar, or use Symphony’s proprietary XML class.

You should check page-, section- and field-names for ampersands or similar.

The only ampersands are wrapped like this: <xsl:text>&amp;</xsl:text>. Will this affect Static Section too?

I fixed this (temp) by changing line 100 to:

$dom = @DOMDocument::loadHTML(str_replace("& ", "&amp; ", $context['output']));

That temp fix worked for me. Must have a random & causing issues somewhere!

Hi guys,

I'm having a similar error:

DOMDocument::loadHTML() [domdocument.loadhtml]: ID fields[-1][location] already defined in Entity, line: 212 An error occurred in /home/storage/1/21/a4/movidacomunicacao/publichtml/teste/skazi/extensions/staticsection/extension.driver.php around line 100

$dom = @DOMDocument::loadHTML(str_replace("& ", "&amp; ", $context['output']));

I've tried the solutions above but nothing worked for me. It's more strange because in my localhost, nothing happens, but online I got this.

Does anyone knows how to solve it?

Thanks a lot!

That temp fix worked for me. Must have a random & causing issues somewhere!

i just noticed that the title of the sections editor has an &ndash; entity in it, which is now being escaped since applying the temp fix (actually displaying &ndash;). do you gents suppose this is the culprit?

do you gents suppose this is the culprit?

I'd bet my spare pencil on it.

I updated this extension to Symphony 2.2.1. It now uses the new delegates for Sections. For the moment it's available here.

I updated this extension to Symphony 2.2.1

Thanks, for me this is one of the most important extensions so far. Will try it out and provide feedback soon.

this came just in time as i noticed our hacky temporary fix was causing ampersands in markdown textareas to append amp; every time you saved the entry.

thanks a ton for picking this up, vlad.

Create an account or sign in 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