Preview doesn't work anymore

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
sandberg

Preview doesn't work anymore

Post by sandberg »

I have a strange problem. When I edit a page and then press the Preview-button, the page starts to load and I see the frame where the page use to show up, but then the whole page turns white and I get a PHP-error:

Code: Select all

Warning: fopen(): Unable to access /export/vol2/unix/c/cs/www.csandberg.se/projekt/uk/tmp/cache/cmspreviewRQ5FHE in /export/vol2/unix/c/cs/www.csandberg.se/projekt/uk/lib/preview.functions.php on line 67
I get some more warnings but all because cmspreviewRQ5FHE doesn't exist. It worked yesterday, but not anymore. I haven't changed the code. Why is this happening?

/ Christian Sandberg

PS. The cache dir is writable.
TNTH

Re: Preview doesn't work anymore

Post by TNTH »

I've had this problem too, I think I solved it by changing the attributes on the cache map. Right now the attributes are: rw-r-r.

Hope it works for you!
sloop

Re: Preview doesn't work anymore

Post by sloop »

I think the content.functions.php script is assuming that the template will always be in the cache - it fopens it for reading without testing to see whether it exists or not.  Talking about-

function preview_get_template ($tpl_name, &$tpl_source, &$smarty_obj)

near line 233 in content.functions.php.  In preview mode, I get the errors:

Code: Select all

<b>Warning</b>:  fopen(/data/www/cms/cmsmadesimple/tmp/cache/cmspreviewYXjA81): failed to open stream: No such file or directory in <b>/data/www/cms/cmsmadesimple/lib/content.functions.php</b> on line <b>247</b><br />
<br />
<b>Warning</b>:  filesize(): Stat failed for /data/www/cms/cmsmadesimple/tmp/cache/cmspreviewYXjA81 (errno=2 - No such file or directory) in <b>/data/www/cms/cmsmadesimple/lib/content.functions.php</b> on line <b>248</b><br />
<br />

<b>Warning</b>:  fread(): supplied argument is not a valid stream resource in <b>/data/www/cms/cmsmadesimple/lib/content.functions.php</b> on line <b>248</b><br />
<br />
<b>Warning</b>:  fclose(): supplied argument is not a valid stream resource in <b>/data/www/cms/cmsmadesimple/lib/content.functions.php</b> on line <b>249</b><br />
<br />
<b>Warning</b>:  unlink(/data/www/cms/cmsmadesimple/tmp/cache/cmspreviewYXjA81): No such file or directory in <b>/data/www/cms/cmsmadesimple/lib/content.functions.php</b> on line <b>250</b><br />
Locked

Return to “CMSMS Core”