WebsiteBaker Community Forum

WebsiteBaker Support (2.10.x) => Modules => Topic started by: kdro on March 16, 2017, 04:23:52 PM

Title: CssToHead problem after upgrade to 2.10.0
Post by: kdro on March 16, 2017, 04:23:52 PM
After an upgrade to 2.10.0 I see an error: There was an uncatched exception
malformed document created in line (54) of (/modules/output_filter/filters/filterCssToHead.php)


Link: http://www.odszkodowania-za-smierc.pl/

As I noticed there is no such a filter (CsstoHead) after the upgrade.

I mention that after noticing the problem I upgraded "Output filter frontend" to v.1.1.7 - but I still can see the error.

Any solutions?

 
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on March 16, 2017, 05:10:51 PM
do you have a section behind the form on the start page in your right block? there is the problem
in most cases a own head-area in this section is the problem or a <link> to a CSS-file inside of this section

Quote
As I noticed there is no such a filter (CsstoHead) after the upgrade.
the filter is integrated now in wb
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 21, 2017, 11:04:07 AM
I have the same problem on this page: http://www.gymnasiumleiden.nl/content/nieuws.php

I tried to update the output_filter module but somehow the CMS doesnt recognize this upgrade.

- I cannot uninstall via the cms the old version
- When i upload the updated module, i get the notice this module already exists
- When i upload it via ftp and select upgrade in the advanced fields, nothing happens.

Problem still exists...

Any ideas?
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 21, 2017, 11:16:58 AM
i try it again.... the problem is not the output-filter-module, its in one of the on this pages used modules
in the most cases, you found in the view.php or included files a code like this

<link....>

to include a css-file - thats the problem

pls go into the section administration of this page nieuws.php and tell me, what kind of modules are in use there

simple solution for this case: use @import in frontend.css instead of this <link...>
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 21, 2017, 03:40:45 PM
Hi,

I am new to WebsiteBaker, sorry if you have to repeat yourself...

The page nieuws has the module "news" activated.

If i search this module, only the file rss.php contains these links, but they dont link to a css file.
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 21, 2017, 03:53:35 PM
whats the used WB-Version - WB 2.10.0 ??

- other modules like Anynews in use?
- any other third party products like weather, locale temperature, advertisments etc there in use?
- any changes, if you use the DefaultTemplate for a test? (remember, its possible, to set this (or any other installed) template for a specially page only - see page settings of this page)?
- any inclusions in the news??

maybe, you can set the used template there to a working template, so that i see the source code of this page
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 21, 2017, 04:04:47 PM
Hi,

Indeed the module anynews is installed.

WB version is 2.10.0

Activating another template does not solve the problem.

What sort of inclusions in the news do you mean? Images, links etc?
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 21, 2017, 04:24:20 PM
the conditions in the filterCSStoHead, are very simple to read and to understand
see the uncommented lines 19 - 23 in this file. if one of the condition is TRUE, you get the exception "malformed document created", because, W3C say's, its malformed

pls go to modules / output_filter / index.php
open this file with a simple editor and deactivate the line 29 with this content
Quote
'CssToHead',
add a double slash (//) in the front of this line, then save the file and upload it to the server (if needed)

after this, the page has to load and i can tell you, where the problem come's from
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 21, 2017, 04:36:57 PM
What sort of inclusions in the news do you mean? Images, links etc?

inclusion from a different, foreign source with no control for the content
any examples: if you write your own news, you know, its not possible, to build malformed content, if you use only the editor in news to add the content, but if you copy that news from a third party webpage, its possible, that this webpage use malformed content

other example: a wrapper inside of a iframe in connection with one of the conditions in filterCSStoHead.php

if the filter works, he try to move a <link> or a <style> inside of the defined areas to the correct place between <head> and </head>. if the output content use a double <body> or double <head>, its not possible, to found the correct start point
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 21, 2017, 04:48:11 PM
The page "nieuws" is a combination of single news items.
There is a specific template build (not by me) for this page.
If i put the slashes in front on line 29 i get a blank page on the newspage.
The single newsitems return a blank page as well btw.
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 21, 2017, 05:02:37 PM
i see it, thanks

but here is the problem, a ending </head>, then a link to the css, then <opening <body>

(https://i.gyazo.com/fbebb18c600d1902620e9757ea2005b4.png)

its no help for you, but the best example for this exception "malformed document created"

back to the topic....
Quote
There is a specific template build (not by me) for this page.

maybe, the problem is inside of the template. if you want, feel free and send me this template via email or post the index.php here
or you compare it with the other (working) template.
- important things:
 - do you use register_frontend_m odfiles(....) in this template?
 - any other code (like my postings) in this index.php?
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 21, 2017, 05:10:17 PM
Yes in this template there is this function:

<?php // allows to include optional module files (frontend.css, frontend.js) into the head
if(function_exists('register_frontend_m odfiles')) {
  register_frontend_m odfiles('css');
  register_frontend_m odfiles('js');
} ?>

I included the index.php as an attachment.
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 21, 2017, 05:41:54 PM
simple problem, if you see the code  ;-)

here your originalcode line between line 28 and line 35

</head>
<?php // allows to include optional module files (frontend.css, frontend.js) into the head
if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('css');
  register_frontend_modfiles('js');
} ?>

<body scroll="auto">

please move the php-part (Ln 29 - Ln 34) into the head area, minimum into the top of the ending </head>. its actual between ending </head> and beginning <body>

P.S.: dont forget to remove the double slashes in modules / output_filter / filters / filterCSStoHead.php  // Ln 29
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 21, 2017, 10:51:26 PM
Hmmm.... unfortunately, that didnt solve it either...
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: Gast on August 22, 2017, 10:59:05 AM
the template works for me now in a simple testarea with a page and some news - so something must be different

is it possible, to give me admin-access to this page?
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 22, 2017, 11:46:15 AM
Thanks, sent you an email
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 22, 2017, 01:34:42 PM
Ok can you hold on for a while?
Site is being restored to an older version...
Title: Re: CssToHead problem after upgrade to 2.10.0
Post by: keesN on August 22, 2017, 01:52:54 PM
Ok backup didnt solve - so we are still with the same problem...