[Solved]-Website blank hack applied - phoca pdf not working

Phoca PDF - creating PDF documents in Joomla! CMS
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

[Solved]-Website blank hack applied - phoca pdf not working

Post by ocular »

have install latest version component and plugin , website went blank when plug in enabled,

Applied kloppo hack
viewtopic.php?f=37&t=5194&start=50#p44090

but no header or footer as saved on plugin seen

Is Phoca pdf not working with this hack?

Is there going to be a fix for the blank website scenario?

------------------------------------------------------------------------
Added 30-10-2010
Solution for Website blank bug due to large number of menu itmes (articles) in main menu
1. Change (or stop) search function, as this seems to cause a time out or memory issue when there is a large number (>40) menu items in main menu.

Turn off search and replace:
in the file "plugins/system/phocapdfcontent.php" replace all "preg_replace" with "str_replace"
(thanks kloppo)

but this is not enough on its own.

2. Change format=pdf to format=phocapdf in pdf icon url link

in the file "components/com_content/helpers/icon.php" replace "format=pdf" with "format=phocapdf"

(this is a change to joomla core file)

Joomla 1.5.20
PhocaPDF Component 1.0.7
PhocaPDF Plugin 1.0.6
Last edited by ocular on 30 Oct 2010, 00:10, edited 2 times in total.
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9451
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Website blank hack applied - but phoca pdf not working

Post by Benno »

Hi,
see: https://www.phoca.cz/documents/50-phoca/ ... al-advices
4. Blank (white) page (or Error 500)

Blank page is mostly displayed in case, some PHP error (Fatal error) stopped the loading of the script (loading of the site). There is no other option how to detect what caused the problem than enabling PHP error reporting on your server or looking at errorlog file on your server. See:

* How to enable displaying PHP errors on site (mostly you need to ask your webhosting provider to enable this feature :-( and disable it again after finding the problem because of security reasons).
Kind regards,
Benno
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: Website blank hack applied - but phoca pdf not working

Post by ocular »

I have looked thru the forum and have not found anyone who has managed to document this as a php script error in a log, correct me if I am wrong.

Taken my site back to localhost WAMP development server, PHP 5.2.9-2, Joomla 1.5.20

Installed Phaco PDF Component 1.07, installed PDF Content plugin 1.06, site opens ,
Enabled PDF plugin, site doesn't open- blank

Checked php.ini, error logs, display error and display startup error are all enabled, checked php error_log - no errors recorded

HTML behind blank page is

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>
i


Not sure what that last "i" is all about

Happy to try and debug further, but would need guidance, the site template is custom, joomla core sef is off, alpharegistration , Xcloner, eXtplorer, Kunena are the installed extensions.
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: Website blank hack applied - but phoca pdf not working

Post by ocular »

There would appear to be a clash between Joomla mod_mainmenu and Phoca PDF.

If I diasbale my main menu then website is visible and Phaco PDF works. I then enabled main menu and problem of blank website returns. Enabled main menu but unpublished about half of them and site was OK (except for lack of all menu items). Incrementally published further menu items and there seems to a limit then all falls over and get a blank website.

There would seem to be a limit of about 30 menu items that can be published before the problem arises. I am not using any 3rd party menu extensions. Has this bug been documented before and is there a work around? Joomla 1.5.20 and PHP 5.2.9-2
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: Website blank hack applied - but phoca pdf not working

Post by ocular »

If there are 36 or less main menu items published then website functions with phoca pdf enabled. If there are 37 or more main menu items published and phoca is enabled then website is blank.

No errors in any of the log files and can't see any joomla debug or error statements as website is blank. Can anyone else produce this problem related to the number of menu items published or suggest where to go from here?
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: Website blank hack applied - but phoca pdf not working

Post by ocular »

I can produce this blank website bug both on my linux host and local WAMP development server by doing a new install of Joomla 1.5.20 with sample data and creating an extra 30 articles attached to 30 main menu items. (Menu10 -->Menu40).

I can publish 39 menu items on main menu and phoca pdf works fine, but when menu40 is published the website goes blank.

There would appear to be a limitation on the number of main menu items that can be used with phoca pdf and joomla 1.5.20

But my skills are now limited as I can't find out why this is happening. Would be keen to know if others can produce this blank website bug with a fresh install of Joomla 1.5.20 and then test compatability with phoca pdf with extra main menu items.
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: Website blank hack applied - but phoca pdf not working

Post by ocular »

Can reproduce the blank website bug on a new install of joomla 1.5.20 and 1.5.6, once 40 menu items are added then website goes blank, If 39 menu items are enabled the menu items 29-39 are blank but the rest work. Same with both versions of joomla. Changed default templates - still goes blank

joomla.southstradbroke.com.au
joom156.southstradbroke.com.au

All error logs - php, server,joomla +debug enabled with no results.

Installed on 2 different servers , WAMP, Linux based with same result, can the developer replicate this?

There would appear to be a bug with phoca pdf and joomla core. Is anyone with more than 40 menu items able to use phoca pdf?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Website blank hack applied - but phoca pdf not working

Post by Jan »

Hi, seems like there is maybe no time for checking all the code on the site for looking at pdf url. In worst case, the article template needs to be hardcoded - it means, the pdf link will be changed to phocapdf and the search - replace function will be disabled. Such way, the Phoca PDF 2 is working (in Joomla! 1.6), there is no search - replace function, because the phocapdf links are hardcoded to article layout.

Jan
If you find Phoca extensions useful, please support the project
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: Website blank hack applied - but phoca pdf not working

Post by ocular »

Not sure how to hard code article template

Seems that it is the no. of menu items published (?in main menu), not the no. of articles published that causes the website blank bug.

Another workaround am looking into is to reduce number of main menu items to articles, but consolidate by using phoca documentation item in main menu. Have modified this to an external link to a specific section and used phoca navigation plug in to step thru articles and produce a table of contents. Trying to figure how to prevent the user from stepping back to the top level of phoca documention listing , otherwise they can step forward and see all sections and categories.

Can confirm that the blank website bug doesnt occur in Joomla 1.6. Added 50 item numbers to Fresh Joomla 1.6 install with sample date and tried phaco pdf.
ocular
Phoca Member
Phoca Member
Posts: 16
Joined: 13 Oct 2010, 14:14

Re: [SOLVED]-Website blank hack applied - phoca pdf not work

Post by ocular »

Solution for Website blank bug due to large number of menu itmes (articles) in main menu

1. Change (or stop) search function, as this seems to cause a time out or memory issue when there is a large number (>40) menu items in main menu.

Turn off search and replace:
in the file "plugins/system/phocapdfcontent.php" replace all "preg_replace" with "str_replace"
(thanks kloppo)

but this is not enough on its own.

2. Change format=pdf to format=phocapdf in pdf icon url link

in the file "components/com_content/helpers/icon.php" replace "format=pdf" with "format=phocapdf"

(this is a change to joomla core file)

This hack was tested on fresh joomla 1.5.20 install with sample data when 40 extra menu items added to main menu hosted on WAMP localhost and also on a Linux live shared host

Joomla 1.5.20
PhocaPDF Component 1.0.7
PhocaPDF plugin 1.0.6

This solution also added to first post of topic and topic marked as solved

Hope it helps others with the blank website issue.
Post Reply