Okay, so this is really bugging me. I am assigning to the template a variable who's value contains a lot of characters (57595 to be exact). Whenever I do this (or other long strings) nothing shows. If I shorten the string to lets say 25000 characters, it shows fine. Now there are a few things I know.....
1) It has nothing to do with the string itself. I can change it to 50000 "x"s and it still doesn't work. Likewise, if I just print the string itself (ie echo $str) it prints fine.
2) It has nothing to do with displaying it. If I remove the line in the template that displays it, it still doesn't work. If I comment out the assign line in the PHP, it works fine though, so I am assuming it has to do with assigning it.
Is this a problem others have had? Is there a limit to the length of the string to be assigned and is there anyway to fix it (other than splitting the text trying to be displayed into multiple variables to assign)?
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn created topic »TagIt 3.0 for Zikula« 09:34 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
- jmvaughn responded to »PN 0.764 to Zikula 1.1.2 (migration) Internal Server Error« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnRender doesn't show when assigned too much text
-
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
-
- Rank: Team Member
- Registered: Dec 07, 2003
- Last visit: May 09, 2010
- Posts: 2703
I would guess you are possibly exceeding your memory limit set your php.ini.
***Nothing more than a guess***
--
David Pahl
Zikula Support Team -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
AmmoDump
I would guess you are possibly exceeding your memory limit set your php.ini.
***Nothing more than a guess***
Unfortunately, that's not it. I tried increasing the memory to a really high amount and it still won't work.
From what I could gather in the pnRender/Smarty code, all 'assign' does is add the key/value to an array. I am able to add a string with 50000 'x's in an array I created without problems.
Thanks for trying though. :) -
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: May 18, 2010
- Posts: 985
http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign
Sometimes differ I found myself
eg
assign var=text value=$subtitle [no quotes]
is not the same as
assign var=text value="This is the subtitle of the title" [quotes]
It seems trivial, but sometimes it does the trick...
not to mention in some cases you need the backticks [or how are they called] ``
- Igor -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
Quote
http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign
Sometimes differ I found myself
eg
assign var=text value=$subtitle
is not the same as
assign var=text value="This is the subtitle of the title"
It seems trivial, but sometimes it does the trick...
not to mention in some cases you need the backticks [or how are they called] ``
- Igor
Oops, that's my fault in explaining. I'm assigning it in the PHP script....
Code
The echo statement works correctly so it has nothing to do with the string or SQL. And whether or not I am actually displaying $des in the template does not matter. -
- Rank: Team Member
- Registered: Jan 19, 2003
- Last visit: Apr 06, 2010
- Posts: 432
askmike1
I am assigning to the template a variable who's value contains a lot of characters (57595 to be exact). Whenever I do this (or other long strings) nothing shows. If I shorten the string to lets say 25000 characters, it shows fine.
I also remember some similar problems I had a few months ago.
Could you please try out 32700 as well as 32800 characters?
--
Guite | ModuleStudio -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
Okay, now my problem has apparently changed. I now get the error ONLY if I place textarea tags around long text. So ie.....
Code
blah blah blah
LONGTEXT HERE
blah blah blah
shows fine, but....
Code
doesn't work.
edited by: askmike1, Oct 15, 2007 - 09:30 AM -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
Have you looked at the page source to see if the text area tags are there? Row and column attributes on the text area?
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Expert
- Registered: Nov 23, 2003
- Last visit: Dec 13, 2009
- Posts: 1487
Just a thought, but have you tried displaying this through different browsers? Could it be a browser issue? I know IE sometimes doesn't like big pages in div tags.
--
Under Construction! -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
HammerHead
Have you looked at the page source to see if the text area tags are there? Row and column attributes on the text area?
The textarea tags are in the template code with row & column attributes (and it only breaks with those textarea tags). I can't look at the source though on the displayed page because.... well... nothing is displayed.
Topiatic
Just a thought, but have you tried displaying this through different browsers? Could it be a browser issue? I know IE sometimes doesn't like big pages in div tags.
Doesn't work with IE or Firefox. :( -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
Any other ideas? This problem only happens when I surround the text with textarea tags (I can display the text fine, I can place it into a hidden input field, I can do basically anything but putting textarea tags around it). Does pnRender, Smarty or Postnuke do something to textarea tags that would cause this problem? -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
I remember having a similar problem about a year ago (.762). I wrote a module that imports data from external databases into Pagesetter publications through a form. I did have the problem in IE and FF, but not in Opera. I eventually found a workaround. Please try Opera and see how that behaves?
Another thought: do you have 'trim white spaces' or 'shortURL' output filters enabled? If you have try switching them of. -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
Okay, so I am now 100% sure this isn't a Smarty problem (I've tried it with just Smarty and can easily display 100,000's of characters). So now I just have to figure out whether this is a pnRender problem or something another part of postnuke is doing.
Now to add to the confusion, if I comment out the $GLOBALS['theme_engine']->themefooter(); line in footer.php, it will display fine (just not within in my theme). The code for themefooter() is....
Code
function themefooter()
{
// end output buffering and get module output
$maincontent = ob_get_contents();
ob_end_clean();
// add the module wrapper
if (!$this->system && (!isset($this->themeconfig['modulewrapper']) || $this->themeconfig['modulewrapper'])) {
$maincontent = '<div id="pn-maincontent" class="pn-module-'.DataUtil::formatForDisplay($this->module).'">'.$maincontent.'</div>';
}
// Assign the main content area to the template engine
$this->assign('maincontent', $maincontent);
// render the page using the correct template
$this->display($this->themeconfig['page'], $this->pageid);
}
(and yes, if I erasefrom my theme template, the page will display, of course with no actual module content)Code
<!--[$maincontent]-->
And no, trimwhitespaces & shorturls being disabled doesn't do anything (and it doesn't work with Opera, FF, IE or Safari). :(
And finally, to add to the confusion even more, if in my main theme template I change
toCode
<!--[$maincontent]-->, it will actually display everything (even when I have the textarea tags)..... of course, it will display the HTML code itself, not what the code is supposed to make.Code
<!--[$maincontent|escape]-->
edited by: askmike1, Oct 19, 2007 - 11:22 PM -
- Rank: Registered User
- Registered: Jan 28, 2006
- Last visit: Jan 22, 2008
- Posts: 14
To simplify things a bit, here is a bit of code I saved as test.php....
Code
<?php
include('includes/pnAPI.php');
pnInit(PN_CORE_ALL & ~PN_CORE_AJAX);
Loader::includeOnce('header.php');
$pnRender = new pnRender("Movies");
$x = '';
for($i=0; $i<50000; $i++) $x .= 'x'; //create 50000 x's
$pnRender->assign('name', $x);
$pnRender->display('test.tpl');
//Loader::includeOnce('footer.php');
?>
test.tpl contains...
Code
<textarea>
<!--[$name]-->
</textarea>
Now as is, that code works fine and it displays the textbox with all the text (just not in my theme template).
If I uncomment the Loader::includeOnce('footer.php'); line, it displays nothing.
If I uncomment that line AND delete the textarea tags, it will display the entire text within my template. -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
Have you got a visual editor or JS quicktags enabled?
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide
- Moderated by:
- Support
