Support

Support Requests

Last post
EvanFillman

EvanFillman
8 posts
---
Location:
n.a.
30.08.2012 02:38

DOMPDF_ENABLE_REMOTE bug

Originally from Phillip Williams in comments

Installed the plugins and published told I need dompdf. Got it upzipped into /library/ dompdf as requested admin crashed with

"Notice: Constant DOMPDF_ENABLE_REMOTE already defined in /homepages/43/d132734153/htdocs/MountainArks/Bathurst01/libraries/dompdf/dompdf_config.inc.php on line 196

Fatal error: Class 'DOMPDF' not found in /homepages/43/d132734153/htdocs/MountainArks/Bathurst01/plugins/system/pdfcontent/pdfcontent.php on line 112"

had to disable dompdf with ftp to get the admin interface back...

Further investigation shows that only "System - PDF Content" crashed the admin interface "Content - PDF Button" doesn't.




 
EvanFillman

EvanFillman
8 posts
---
Location:
n.a.
30.08.2012 02:41

Re: DOMPDF_ENABLE_REMOTE bug

Phillip,

Sorry for the hassle with your site. Hopefully we can get this figured out.

Just some troubleshooting questions. When you uploaded the DOMPDF to your joomla/libraries folder did you make any changes to the DOMPDF configuration files? The only reason I ask this is because no setup is required of the DOMPDF files, the plugin sets it up for you.

Additionally the best way to upload DOMPDF to your server is to upload the entire zip file and then extract it if able. You might be able to upload the zip file and then login to your hosts web based file manager to see if they provide and unzip function.




 
PhilipWilliams

PhilipWilliams
3 posts
---
Location:
Norwich
United Kingdom
30.08.2012 06:15

Re: DOMPDF_ENABLE_REMOTE bug

Ok -- that site is hosted on 1and1 -- PHP5.4.5 (only alternative is 5.2.17)

I just unpacked the dompdf and fireftpd it to libraries/dompdf..now deleted

Uses the hosts file manager to upload the zip and unzip it on the server...

dompdf-0.5.2.zip

same error

Notice: Constant DOMPDF_ENABLE_REMOTE already defined in /homepages/43/d132734153/htdocs/MountainArks/Bathurst01/libraries/dompdf/dompdf_config.inc.php on line 196

Fatal error: Class 'DOMPDF' not found in /homepages/43/d132734153/htdocs/MountainArks/Bathurst01/plugins/system/pdfcontent/pdfcontent.php on line 112

:')


Old and mostly in the way
www.tacouk.com

 
admin

admin
5 posts
---
Location:
n.a.
30.08.2012 11:25

Re: DOMPDF_ENABLE_REMOTE bug

Try commenting out the DOMPDF_ENABLE_REMOTE variable in the file dompdf_config.inc.php. Once the DOMPDF folder is unzipped just open up the file in a text editor and comment out the line using // at the begining of the line. Should be line 288

Another trick. If DOMPDF is still blowing up your site just rename the folder to dompdf1 and then it should stop for your to troubleshoot.




 
PhilipWilliams

PhilipWilliams
3 posts
---
Location:
Norwich
United Kingdom
31.08.2012 00:31

Re: DOMPDF_ENABLE_REMOTE bug

The dompdf_config_inc.php has only 247 lines in Dreamweaver. DOMPDF_ENABLE_REMOTE is on line 196 as the error message says.

Duly commented out and that cleared the first warning message but not the fatal one...

"Fatal error: Class 'DOMPDF' not found in /homepages/43/d132734153/htdocs/MountainArks/Bathurst01/plugins/system/pdfcontent/pdfcontent.php on line 112"

which I guess is on line 111/112 of your extension PHP...

//create new dompdf engine
$this->engine =new DOMPDF();

I don't know hardly anything about PHP (I am an old Fortran programmer!) but I guess that the reasons this fails is something to do with your PHP not finding a definition of DOMPDF, is it something to do with its location? Dompdf.php says:

* Usage: ./dompdf.php [options] html_file


Had already rescued the site but renaming the library to dompdf.bust as in my original note.

The issue with DOMPDF_ENABLE_REMOTE is probably around lines 93 to 102 of your code:


//check for dompdf configuration file
$file = JPATH_LIBRARIES .'/dompdf/dompdf_config.inc.php';
if (!JFile::exists($file))
{
return false;
}
if (!defined('DOMPDF_ENABLE_REMOTE'))
{
define('DOMPDF_ENABLE_REMOTE', true);
}


Old and mostly in the way
www.tacouk.com

 
admin

admin
5 posts
---
Location:
n.a.
04.09.2012 12:35

Re: DOMPDF_ENABLE_REMOTE bug

Got your review on the JED. Pretty harsh. I am currently deployed in support of America's multiple wars (for better or worse) and developing is currently only a hobby of mine. I was actually flying along side some of your country men a few days ago (just going off of your profile that says you are from the UK).

As a previous coder of Fortran you should understand how difficult an isolated bug can be to find. This plugin is still very new and I only tested it on the default joomla installation as noted on the download page. The problem we are fighting here is there is about a thousand variables that could be different with your joomla / server / php / additional plugins thats causing the error. Additionally, you'll notice this is the first plugin that has attempted this, and thats because its a tricky maneuver to preform with joomla (generating PDFs).

If you really want me to find this error it will take extensive troubleshooting. If it is still worth your time.

The frist step I will need you to do is to try the plugin on a default joomla installation on your server. Perhaps you can create one in a subdirectory on your server and sql server. It should not take much time. This way we will be able to tell if it is a problem with your current joomla setup or if it is a more generic problem with your PHP / server setup.




 
PhilipWilliams

PhilipWilliams
3 posts
---
Location:
Norwich
United Kingdom
04.09.2012 23:27

Re: DOMPDF_ENABLE_REMOTE bug

I am very sorry that you took my review as harsh, it was not meant to be, just accurate. Obviously I was not aware of your circumstances and a brief note to that effect would have held off my review.

I do understand how difficult it is to find bugs especially as I read that PHP is a complete PITA for debugging. It might well be an interaction between other plugins, especially if it works on a clean Joomla installation.I did recognise in my review that it is an excellent idea and a pity it did not work. It is a really great idea to try and replace the functionality we had in Joomla 1.5 - I guess I should Google to try and find out why it was removed...

I am happy to take the time to assist in trouble shooting to try fix the bug. The problem is that I have a deadline to deliver a website by the end of this week ... and after that I am out of the country for a couple of weeks. So it will be a while before I can put it on a variety of other sites. As it was I did not put it on the site I have to deliver but an other when in an earlier state of development. On my return I will try it on other sites and on a clean install site.- actually whilst I am on holiday, if my wife doesn't notice, I will try it on localhost.

Yes I am in the UK , will be visiting your country for thanksgiving.

Regards


Old and mostly in the way
www.tacouk.com

 
TravisBeatty

TravisBeatty
2 posts
---
Location:
n.a.
17.12.2012 09:40

Re: DOMPDF_ENABLE_REMOTE bug

G'Day Gents,

I'm wondering if Philip installed a pre-configured flavour of Joomla like the Vertex SiteShaper from Shape5? I've been getting this message as well and likely it is due to how everything is organized... This custom template has a specific folder for the code displaying content that is other than the default Joomla directory. So... I'm thinking that the developer's suggestion that it is due to changes made to Joomla itself are likely the cause...

I'll keep you guys posted if I figure it out.

Thanks


Travis

Edited by TravisBeatty - 17.12.2012 09:41




 
TravisBeatty

TravisBeatty
2 posts
---
Location:
n.a.
17.12.2012 11:00

Re: DOMPDF_ENABLE_REMOTE bug

Just an update...

I uninstalled both plugins and deleted the dompdf folder from the libraries dir. Then I downloaded the newest (beta) version of dompdf -> which is version 3. Installed the content-button plugin first and enabled it from the extensions manager screen, then installed the system - content pdf plugin and enabled it from the extensions manager screen as well. This time, didn't get any errors... The "print" icon is the same as "new page", not a pdf type icon... Where do I configure that?!

:)

Thanks


Travis

Edited by TravisBeatty - 17.12.2012 11:02