undkonsorten / powermailpdf

When a user fills a powermail form he will get a download link for a pdf file which contains the values he just entered. Also the pdf can be attached to an email and send to the user.
1 stars 7 forks source link

PHP Warning throws exception on installation #4

Closed sypets closed 5 years ago

sypets commented 6 years ago

This breaks the installation if you have Configuration preset debug on.

1)

https://github.com/undkonsorten/powermailpdf/blob/master/ext_tables.php#L23

pdf should be 'pdf' ?

2) and line 26.

Reproduce:

  1. composer require typo3-ter/powermailpdf

  2. Set configuration preset to debug in Install Tool

  3. Activate extension in extension manager

System

Exception dump

Uncaught TYPO3 Exception
#1476107295: PHP Warning: Use of undefined constant pdf - assumed 'pdf' (this will throw an Error in a future version of PHP) in /var/www/t3intro8composer/htdocs/typo3conf/ext/powermailpdf/ext_tables.php line 23 (More information)

TYPO3\CMS\Core\Error\Exception thrown in file
/var/www/t3intro8composer/htdocs/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 107.

22 TYPO3\CMS\Core\Error\ErrorHandler::handleError(2, "Use of undefined constant pdf - assumed 'pdf' (this will throw an Error in a future version of PHP)", "/var/www/t3intro8composer/htdocs/typo3conf/ext/powermailpdf/ext_tables.php", 23, array)

/var/www/t3intro8composer/htdocs/typo3conf/ext/powermailpdf/ext_tables.php:
00021: 
00022: 
00023: $pluginSignature = str_replace('_','',$_EXTKEY) . '_' . pdf;
00024: $TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
00025: 

21 require("/var/www/t3intro8composer/htdocs/typo3conf/ext/powermailpdf/ext_tables.php")

/var/www/t3intro8composer/htdocs/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:
01880:                 // and are explicitly set in cached file as well
01881:                 $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] ?? null;
01882:                 require $extensionInformation['ext_tables.php'];
01883:             }
01884:         }

20 TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadSingleExtTablesFiles()

/var/www/t3intro8composer/htdocs/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:
01859:             }
01860:         } else {
01861:             self::loadSingleExtTablesFiles();
01862:         }
01863:     }
cumuru commented 6 years ago

Thanks for reporting @sypets, wrapping with single quotes sounds absolutely reasonable. Could you create a PR?

sypets commented 6 years ago

ok, see PR #5