Author Topic: CssToHead problem after upgrade to 2.10.0  (Read 2735 times)

Offline kdro

  • Posts: 11
CssToHead problem after upgrade to 2.10.0
« 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?

 

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #1 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #2 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?

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #3 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...>
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #4 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.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #5 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #6 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?
« Last Edit: August 21, 2017, 04:20:52 PM by keesN »

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #7 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #8 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #9 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.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #10 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>



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?
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #11 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.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #12 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
« Last Edit: August 21, 2017, 05:52:16 PM by jacobi22 »
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #13 on: August 21, 2017, 10:51:26 PM »
Hmmm.... unfortunately, that didnt solve it either...

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CssToHead problem after upgrade to 2.10.0
« Reply #14 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?
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #15 on: August 22, 2017, 11:46:15 AM »
Thanks, sent you an email

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #16 on: August 22, 2017, 01:34:42 PM »
Ok can you hold on for a while?
Site is being restored to an older version...

Offline keesN

  • Posts: 9
Re: CssToHead problem after upgrade to 2.10.0
« Reply #17 on: August 22, 2017, 01:52:54 PM »
Ok backup didnt solve - so we are still with the same problem...

 

postern-length