AllowEmpty=true for paragraph is generated without  

Author Message

Anja Lundin

Tuesday 17 April 2007 7:20:58 am

There seem to be a bug in eZ publish 3.9.1 regarding the AllowEmpty for paragraphs in content.ini. If this parameter is set to true the XML-editor renders

<p>&nbsp;</p>

, in the file ezdhtmlxmlinput.php in the editor (OE 4.2.2) extension. So far so good.

The output of the text on the other hand is shown as only

<p></p>

without  . This results in only one break and the idea of this setting is to allow multiple empty paragraphs, isn't it?

I have noticed there is a lot of changes in the eZXHTMLXMLOutput class from 3.8.6 to 3.9.1. In example the function renderXHTMLParagraph is replaced (?) with the function renderParagraph and as far as I can see the problem is in that function somewhere.

Does anyone else have the same problem as I? Is there a bug in 3.9.1 regarding allow empty paragraphs? I haven't found any bugreports yet regarding this, should I report it?

Best regards!

/Anja Bjerleus, Novitell AB

------------------------------------
Anja Lundin
Developer, Novitell AB
Sweden

www.novitell.se

Brendan Pike

Thursday 24 May 2007 8:28:04 pm

Hi Anja, did you find any solution to this, I've run into the same problem on 3.9.0 not yet tested on 3.9.2 though.

Edit: In my opinion this is a bug, so please do report it as such. Here is a crude work around until it's fixed.

Create an override template for design/standard/templates/content/datatype/view/ezxmltags/paragraph.tpl

After

{$content}

add the following

{if $content|not}&nbsp;{/if}

Cheers
Brendan

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Anja Lundin

Thursday 24 May 2007 11:12:22 pm

Hi Brendan,
It's interesting to hear other people have troubles with this functionallity. For a while I was worried there was something wrong with my installations only. I will report this as a bug now.

My work around is this:


{*if there is not $content and 'AllowEmpty' for paragraph in content.ini is set to true*}
{if and($content|not,ezini('paragraph','AllowEmpty','content.ini')|eq('true'))}
<p{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>&nbsp;</p>

{*otherwise*}
{else}
<p{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>{$content}</p>
{/if}

Best regards!

/Anja Bjerleus, Novitell AB

------------------------------------
Anja Lundin
Developer, Novitell AB
Sweden

www.novitell.se

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:04:44
Script start
Timing: Jan 18 2025 19:04:44
Module start 'layout'
Timing: Jan 18 2025 19:04:44
Module start 'content'
Timing: Jan 18 2025 19:04:45
Module end 'content'
Timing: Jan 18 2025 19:04:45
Script end

Main resources:

Total runtime0.7255 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.1563152.6563
Module start 'layout' 0.00640.0033 740.812539.5078
Module start 'content' 0.00970.7145 780.3203542.6797
Module end 'content' 0.72430.0012 1,323.000012.0938
Script end 0.7255  1,335.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4591160.0002
Check MTime0.00120.1716160.0001
Mysql Total
Database connection0.00090.125910.0009
Mysqli_queries0.668392.1105570.0117
Looping result0.00050.0672550.0000
Template Total0.695895.920.3479
Template load0.00190.255420.0009
Template processing0.693995.640220.3469
Template load and register function0.00020.021410.0002
states
state_id_array0.00100.140010.0010
state_identifier_array0.00090.123220.0004
Override
Cache load0.00150.2123320.0000
Sytem overhead
Fetch class attribute can translate value0.00070.101720.0004
Fetch class attribute name0.00120.171640.0003
XML
Image XML parsing0.00200.280520.0010
class_abstraction
Instantiating content class attribute0.00000.001850.0000
General
dbfile0.00270.3734160.0002
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs