Forums / General / weird text at start of page

weird text at start of page

Author Message

Scott Foster

Monday 20 December 2010 1:12:58 am

Sometimes I see text like $arr_14 ) ) ); ?> or "/> " /> at the VERY beginning of the page. Clearing template cache fixes this immediately, but is there anyway to prevent things like this from happening or know what might be causing this?

Jérôme Vieilledent

Monday 20 December 2010 1:45:05 am

Hi Scott

Which version of eZ Publish do you use ? Which version of PHP ?

I had this issue with eZ Publish versions prior to 4.1.4, running with PHP 5.3 (eZ is compatible with PHP 5.3 from v4.1.4)

Steven E. Bailey

Monday 20 December 2010 2:54:30 am

I remember this happening at some point and it turned out to be incorrectly closed ini files (opened with <? but not closed with ?> or with junk after the ?>). Although the $array_14 points to a failure in a template. I had a shell script template checker in contributions somewhere but I can't find it now... so I'll paste it here - it might be useful in tracking down stranded tags:

#!/bin/bash
tplfile=${@:$#} 
cmd=`basename $0`
#case {case {[/c][ca][as][se][e/]}
gettags ()
{
cat - <<EOF |grep -v "^#"
div <div </div>
span <span </span>
li <li[^n] </li>
ul <ul </ul>
ol <ol </ol>
tr <tr </tr>
td <td </td>
table <table </table>
if {if {/if} {else
case {case {/case}
switch {switch {/switch}
let {let {/let}
default {default {/default}
foreach {foreach {/foreach}
section {section[^-] {/section} {section-
append {append-block {/append-block}
cache {cache-block {/cache-block}
bracket-space {[[:space:]]  this_should_never_match_on_anything
EOF
}
matchtag ()
{
        matchtag=`echo $1|sed 's/\[.*\]$//'` #This is needed to stop the <li
        cat "$tplfile"|grep "$1"|                    #from matching on link with <li[^n]
        awk -v matchtag=$matchtag -v endtag=$endtag -v elsetag=${elsetag:-"this_is_a_long_dummy_string"} 'BEGIN{FS=endtag}{
                for(i=1;i<=NF;i++) {
                        if ( matchtag != elsetag && $i ~ elsetag ) {
                                continue
                        } else {
                                if ( $i ~ matchtag ) {total = total + 1}
                        }
                }
        } END {
        print total
        }'
}
checktags ()
{
else=0
dirtyflag=0
elsetag=""
gettags|while read label opentag closetag elsetag
do
        endtag=${closetag:$((${#closetag} - 1)):1}
        closetag=${closetag:0:$((${#closetag} - 1))}
        open=`matchtag $opentag|tail -1`
        close=`matchtag $closetag|tail -1`
        if [ -n "$elsetag" ]
        then
                else=`matchtag $elsetag|tail -1`
                if [ "${opt}" = "-v" ]
                then
                        echo $label $opentag ${open:-0} $closetag ${close:-0} ${else:+elsetag $else}
                fi
        else
                if [ "${opt}" = "-v" ]
                then
                        echo $label $opentag ${open:-0} $closetag ${close:-0}
                fi
        fi
        if [ "${open:-0}" -ne "${close:-0}" ]
        then 
                if [ "$1" = "verbose" ]
                then
                        echo -e "Uneven ${label} tags: ${label}-open: ${open:-0} ${label}-close: ${close:-0}\c"
                        if [ -n "$elsetag" -a ${else:-0} -ne 0 ]
                        then
                                echo -e " ${label}-else: ${else:-0}\c"
                        fi
                        echo
                else
                        dirtyflag=1
                        echo $dirtyflag
                fi
        fi
done
}
########
# MAIN #
########
if [ $# -lt 1 ]
then
        echo -e "Usage:\t $cmd <file|directory>"
        echo -e "\t\t<directory> is recursive"
        echo -e "\t\t-v (verbose) also displays clean files"
        exit
elif [ "$1" != "$tplfile" -a "$1" = "-v" ]
then
        opt="-v"
fi
if [ "$tplfile" = "." ]
then
        tplfile=$PWD
elif [ "$tplfile" = ".." ]
then
        tplfile=`dirname $PWD`
fi
if [ -d "$tplfile" ]
then
        echo "#### Starting from $tplfile ####"
        find $tplfile -name "*.tpl" -print|while read file
        do
                $0 ${opt} ${file}
        done
        exit
fi

dirtyflag=`checktags`
if [ -n "${dirtyflag}" ]
then
        echo "##### "$tplfile" #####"
        checktags verbose
elif [ "${opt}" = "-v" ]
then
        echo "##### "$tplfile" #####"
        echo "`basename $tplfile` appears clean"
fi

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Scott Foster

Monday 20 December 2010 6:51:07 am

"

Hi Scott

Which version of eZ Publish do you use ? Which version of PHP ?

I had this issue with eZ Publish versions prior to 4.1.4, running with PHP 5.3 (eZ is compatible with PHP 5.3 from v4.1.4)

"

running PHP 5.3.3 with eZ Publish 4.3

eZ debug

Timing: Jan 30 2025 00:52:07
Script start
Timing: Jan 30 2025 00:52:07
Module start 'content'
Timing: Jan 30 2025 00:52:07
Module end 'content'
Timing: Jan 30 2025 00:52:07
Script end

Main resources:

Total runtime0.1217 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 587.9219180.8516
Module start 'content' 0.00690.0052 768.773497.9922
Module end 'content' 0.01210.1095 866.7656525.8828
Script end 0.1216  1,392.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.8946200.0002
Check MTime0.00141.1327200.0001
Mysql Total
Database connection0.00181.517310.0018
Mysqli_queries0.082067.40681410.0006
Looping result0.00100.84341390.0000
Template Total0.109189.710.1091
Template load0.00090.726410.0009
Template processing0.108288.920410.1082
Override
Cache load0.00060.515410.0006
Sytem overhead
Fetch class attribute can translate value0.00070.584410.0007
XML
Image XML parsing0.00020.166810.0002
General
dbfile0.00272.2244200.0001
String conversion0.00000.002430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs