Ajax problem due to the empty line in the beginning of the page output

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Sonya

Ajax problem due to the empty line in the beginning of the page output

Post by Sonya »

When I see the HTML source of my page I can see an empty line at the beginning of the HTML source:

Code: Select all

1: 
2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3: <__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
This causes Ajax error in the admin panel. Whenever I click on Collapse all Sections or Expand All Sections in the content list (Content » Pages) I get an error with Firebug:
XML Parsing Error: XML or text declaration not at start of entity
Location: http://xxxxx/admin/listcontent.php?sp_=ed0f1b93
Line Number 2, Column 1:
CMSMS version 1.9.2.

I have some installations that do have an empty line in output and some that not. Trying to figure out the difference between them, I noticed that there is no empty line after the fresh install. When I install the modules Polls and AjaxMadeSimple the empty line appears and it DOES NOT disappear even if the both modules are uninstalled and completely removed.

Additionally, I have figured out that lines are added somewhere BEFORE

Code: Select all

echo $html;
So that trimming output at this place does not take any effect.

Can someone reproduce the issue?

EDIT: Further debugging shows that empty line is added after the line

Code: Select all

$modload->LoadModules(isset($LOAD_ALL_MODULES), !isset($CMS_ADMIN_PAGE));
in include.php
Last edited by Sonya on Mon Dec 27, 2010 12:51 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Ajax problem due to the empty line in the beginning of the page output

Post by RonnyK »

Sonya,

I am not seeing the blank line in my source of latest... Does your template have the logic at the first line, or is there a blank there already?

Make sure that the page-template starts like...
{process_pagedata}
and NOT like:

{process_pagedata}
Ronny
Sonya

Re: Ajax problem due to the empty line in the beginning of t

Post by Sonya »

RonnyK wrote: Does your template have the logic at the first line, or is there a blank there already?
Yes, it does solve a problem temporary.

I guess that empty line is added somewhere in the include.php before the template is parsed. I have made further debugging and am now in the class.moduleloader.php. It seems that the line is produced in LoadModules(), somewhere in the

Code: Select all

while ($result && !$result->EOF)
Last edited by Sonya on Wed Jan 19, 2011 4:18 pm, edited 1 time in total.
Sonya

Re: Ajax problem due to the empty line in the beginning of t

Post by Sonya »

This strange behavior has been already submitted http://dev.cmsmadesimple.org/bug/view/5350
Last edited by Sonya on Wed Jan 19, 2011 4:19 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Ajax problem due to the empty line in the beginning of the page output

Post by RonnyK »

oops,

only now I see (after being told), that it is the backend which you are talking about ;) I was looking for the frontend templates.

Ronny
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm

Re: Ajax problem due to the empty line in the beginning of t

Post by scooper »

I just came across this problem when moving a new (1.10.3) site across from a development server.
On the dev server everything worked fine but on the live server the problem that Sonya describes above occurred with the result that the client couldn't expand / contract pages.

After much poking around I found that one of the modules (Showtime) was reported as having 'invalid CR/LF or Null characters' when opened in my Editplus (in Geany and other text editors it opens with extra line breaks).

Quite why it was working on one server and not the other I still don't know - they were both unix boxes with very similar specs, but opening all the files in Editplus and saving them back out with the linebreaks fixed solved the problem. No blank lines at the start of the html and no xml errors.

Hope that gives a clue for anyone with the same issue.

s.
Locked

Return to “CMSMS Core”