Closed (fixed)
Project:
Printer, email and PDF versions
Version:
7.x-2.0-beta2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2013 at 11:45 UTC
Updated:
25 Jul 2013 at 06:51 UTC
When using `print_pdf_generate_path` (like mentioned in http://drupal.org/node/190173#pdf_via_mail) multiple times in the same request some notices are shown:
Notice: Constant DOMPDF_ENABLE_PHP already defined in _print_pdf_dompdf() (line 182 in ../sites/all/modules/contrib/print/print_pdf/print_pdf.pages.inc).
Simple fix would be to also check for if the constant is already defined:
// In function _print_pdf_dompdf, line 175
if (variable_get('print_pdf_autoconfig', PRINT_PDF_AUTOCONFIG_DEFAULT)) {
// should be
if (variable_get('print_pdf_autoconfig', PRINT_PDF_AUTOCONFIG_DEFAULT) && !defined('DOMPDF_ENABLE_PHP')) {
Comments
Comment #1
spyrosk commentedI don't know if this should be in a separate ticket but we faced a similar issue with 7.x-2.0-beta2 that actually caused pathauto to stop working (no new aliases could be generated and the URL aliases configuration page was missing all content except for the "Save configuration" button).
These are the notices that were generated:
The fix was to first check if the constant was defined before declaring it:
Comment #2
jcnventura@SpadXIII - thanks for the report. I have now fixed in git: http://drupalcode.org/project/print.git/commit/6a2c871
@spyrosk - huh? The only way those could happen is if in some weird way, the module code is being included TWICE. That should never ever happen. In this case, I'll do "as core does" and leave those defines as they are. If you still get those notices, check your code and make sure that you use include_once or require_once for the module files.