Fatal error on Content Areas new install

Hello,

After installing the Content Areas Plugin I get this Fatal error. Any idea how to get this going? Thanks.

Fatal error: Call to a member function appendChild() on null in www/lists/admin/plugins/ContentAreas/ContentAreaBase.php on line 53
phpList version 3.3.1

I solved it for now. As a test I included the sample html from the plugin. And guess what that is working nice. So i must have a fault in my html. template than :slight_smile:

Have been a bit to fast. Including my own template results in the error again. So what could be my mistake?

Sorry a software error occurred:
Please report a bug when reporting the bug, please include URL and the entire content of this page.

Fatal error: Uncaught exception ‘ErrorException’ with message ‘DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 428’ in /var/www/l/www/lists/admin/plugins/ContentAreas/TemplateModel.php:204 Stack trace: #0 [internal function]: phpList\plugin\Common\Exception::errorHandler(2, ‘DOMDocument::lo…’, ‘/var/www/www…’, 204, Array) #1 /var/www//www/lists/admin/plugins/ContentAreas/TemplateModel.php(204): DOMDocument->loadHTML(‘loadHtml(’__construct(’<!DOCTYPE html …’) #4 /var/www/www. /www/lists/admin/plugins/ContentAreas.php(120): phpList\plugin\ContentAreas\TemplateModel::isTemplateBody(’<!DOCTYPE html …’) #5 /var/www/www.p in /var/www/www. /www/lists/admin/plugins/ContentAreas/TemplateModel.php on line 204
phpList version 3.3.1

This is what I have in my template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
</head>

<body><!-- [CONTENT] -->
  <style>
</style>

than my table:

 <!-- start of repeating item -->
          <table data-repeatable="article" class="row" style="border-collapse: collapse; border-spacing: 0; display: table; padding: 0; position: relative; text-align: left; vertical-align: top; width: 100%;">
            <tbody>
              <tr style="padding: 0; text-align: left; vertical-align: top;">
                <th class="small-12 large-6 first columns" "hide-for-small" style="Margin: 0 auto; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; padding: 0; padding-bottom: 16px; padding-left: 16px; padding-right: 8px; text-align: left; width: 274px;">
                  <h3 data-edit="article-title" data-type="text" style="Margin: 0; Margin-bottom: 10px; color: inherit; font-family: Roboto, Helvetica, Arial, sans-serif; font-size: 28px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left; word-wrap: normal;">My Article header</h3>
                  <p data-edit="article-content"  style="Margin: 0; Margin-bottom: 10px; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;">Some article text here!</p>

                </th>
                <th class="small-12 large-6 last columns" style="Margin: 0 auto; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; padding: 0; padding-bottom: 16px; padding-left: 8px; padding-right: 16px; text-align: left; width: 274px;">
                  <p style="Margin: 0; Margin-bottom: 10px; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;"><img  data-edit="article-image" src="http://placehold.it/300x200" alt="" style="-ms-interpolation-mode: bicubic; clear: both; display: block; max-width: 100%; outline: none; text-decoration: none; width: auto;"></p>
                </th>
                <th class="expander" style="Margin: 0; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; padding: 0 !important; text-align: left; visibility: hidden; width: 0;"></th>
              </tr>
            </tbody>
          </table>
              <!-- end of repeating item -->

my other parts of the table …

So what’s wrong here?

@DuncanC is the guy you want, but have you also installed the Common Plugin? The Content plugin does require that.

I have all the plugins in place. With the sample-template from the Content Area plugin it is w0rking fine. But not with my own template though! Seems that this: error parsing attribute name.
Is causing an error?
How to use the correct attribute names? Can I also have one for images? data-edit=“article-image” ?

The error reporting isn’t great but I think this indicates line 428 of your template. Can you copy that line and a few surrounding lines here.

@duncanc Thanks for your reply. Looking at line 428 than the error is in the repeating part of the template?

  <!-- Content block afbeelding rechts tekst links -->

  <!-- start of repeating item -->
  <table data-repeatable="article" class="row" style="border-collapse: collapse; border-spacing: 0; display: table; padding: 0; position: relative; text-align: left; vertical-align: top; width: 100%;">
    <tbody>
      <tr style="padding: 0; text-align: left; vertical-align: top;">
        <th class="small-12 large-6 first columns" "hide-for-small" style="Margin: 0 auto; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; padding: 0; padding-bottom: 16px; padding-left: 16px; padding-right: 8px; text-align: left; width: 274px;">
          <h3 data-edit="article-title" data-type="text" style="Margin: 0; Margin-bottom: 10px; color: inherit; font-family: Roboto, Helvetica, Arial, sans-serif; font-size: 28px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left; word-wrap: normal;">My Article header</h3>
          <p data-edit="article-content"  style="Margin: 0; Margin-bottom: 10px; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;">Some article text here!</p>

        </th>
        <th class="small-12 large-6 last columns" style="Margin: 0 auto; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; padding: 0; padding-bottom: 16px; padding-left: 8px; padding-right: 16px; text-align: left; width: 274px;">
          <p style="Margin: 0; Margin-bottom: 10px; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;"><img   src="http://placehold.it/300x200" alt="" style="-ms-interpolation-mode: bicubic; clear: both; display: block; max-width: 100%; outline: none; text-decoration: none; width: auto;"></p>
        </th>
        <th class="expander" style="Margin: 0; color: #0a0a0a; font-family: Roboto,Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0; padding: 0 !important; text-align: left; visibility: hidden; width: 0;"></th>
      </tr>
      <!-- end of repeating item -->
    </tbody>
  </table>

This is badly-formed.

Why is that? This is just the “Foundation e-mail” grid code. If I have to leave that out than my design is gone as well my responsive layout. I tried it with-out and than the error is gone. but as said my design is gone also.
As you can see in the screen shot the repeating part above and the original layout below having padding and other text formatting :

Not the whole thing. What do you mean by “hide-for-small” on its own like that?

Ok, did not see the quotation marks there :slight_smile: thanks. Now it is better. Even my images editing is working. The hide-for-small was just there for testing but does not work. The idea was on small screens only show the images (on a mobile). I had an e-mail coming in which had that applied I tried to copy that using the Foundation css.
One minor thing I now lost my header logo image might be a path or so which is no longer valid? I have my logo hard-coded in the template.

Although I have my logo back :slight_smile: On mobile the mail looks terrible. Not responsive any more.

When I try to open “preview” in the Content Area tab I get a bunch of errors. Referring to a

tag but that one is not there. I don’t know if this has something to do with the template or has an other cause.
I made a paste-bin with the template:

https://pastebin.com/gzSDfX4B

And this i show it looks on my iPhone images are not "resized and things are floating over each other. :

@MrMailer Using your template the Preview seems to display without any errors. Also, sending an email using the template seems to display ok on an android phone. The article text does not expand to fill the whole width but remains on the left hand side.

Sorry, I’m not able to debug the template html. But if you can show that the plugin is somehow changing the html in an unexpected way then I try to fix such a problem.

This is the error that is generated when previewing the message. In the source code of the html received in my mail-prog I do not see any strange html although the source is hard to read with my mac mail. Is there a better way to explore the mail source code on a mac?

DOMDocument::loadHTML(): Unexpected end tag : p in Entity, line: 372

#0 [internal function]: phpList\plugin\Common\Exception::errorHandler(2, 'DOMDocument::lo...', '/var/www/www.pi...', 237, Array)
#1 /var/www/.nl/www/lists/admin/plugins/ContentAreas/vendor/crossjoin/pre-mailer/src/Crossjoin/PreMailer/PreMailerAbstract.php(237): DOMDocument->loadHTML('<!DOCTYPE html>...')
#2 /var/www/www./www/lists/admin/plugins/ContentAreas/vendor/crossjoin/pre-mailer/src/Crossjoin/PreMailer/PreMailerAbstract.php(201): Crossjoin\PreMailer\PreMailerAbstract->prepareContent()
#3 /var/www/wl/www/lists/admin/plugins/ContentAreas/CssInlinerFactory.php(28): Crossjoin\PreMailer\PreMailerAbstract->getHtml()
#4 /var/www/www.pl/www/lists/admin/plugins/ContentAreas/TemplateModel.php(243): phpList\plugin\ContentAreas\PreMailerCssInliner->inlineCss('<!DOCTYPE html>...')
#5 /var/www/w.nl/www/lists/admin/plugins/ContentAreas/MessageController.php(20): phpList\plugin\ContentAreas\TemplateModel->merge(Array, false)
#6 /var/www/wl/www/lists/admin/plugins/ContentAreas/MessageController.php(31): phpList\plugin\ContentAreas\MessageController->mergeTemplateWithMessage(false)
#7 /var/www/wwwl/www/lists/admin/plugins/Common/Controller.php(112): phpList\plugin\ContentAreas\MessageController->actionPreview()
#8 /var/www/wwnl/www/lists/admin/plugins/Common/Main.php(43): phpList\plugin\Common\Controller->run('preview')
#9 /var/www/wnl/www/lists/admin/plugins/ContentAreas/message_page.php(20): phpList\plugin\Common\Main::run(Object(phpList\plugin\ContentAreas\ControllerFactory))
#10 /var/www/wwl/www/lists/admin/index.php(712): include('/var/www/www.pi...')
#11 {main}

This indicates that there is a stray </p> end tag in the document.

@duncanc I have gone through the html template but there is no

end tag without a starting

tag?

@MrMailer If the template is fine then the problem must be in one of the content areas that you have entered. Check the html for each of the articles.

@MrMailer This is probably the cause of the problem

`


Some article text here!

`

When you use CKEditor to edit the content it appears to wrap the content with its own p tags, which means you end up with nested p tags, which is invalid html. You should use a div element instead of p.

Thanks I tried that and seems to be the solution. Thanks :slight_smile: