Open
Description
When I add an image to the generations process the vCard is generated as it should. But inside the code that is generated an error message from Craft CMS is added:
<pre>An Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent in /home/hicefuvo/www/spherene/sphereneV1/vendor/jeroendesloovere/vcard/src/VCard.php on line 623. in /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/web/Response.php:373
Stack trace:
#0 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/web/Response.php(346): yii\web\Response->sendHeaders()
#1 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
#2 /home/hicefuvo/www/spherene/sphereneV1/vendor/craftcms/cms/src/web/ErrorHandler.php(192): yii\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))
#3 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/base/ErrorHandler.php(135): craft\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))
#4 /home/hicefuvo/www/spherene/sphereneV1/vendor/craftcms/cms/src/web/ErrorHandler.php(71): yii\base\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#5 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#6 {main}
Previous exception:
yii\web\HeadersAlreadySentException: Headers already sent in /home/hicefuvo/www/spherene/sphereneV1/vendor/jeroendesloovere/vcard/src/VCard.php on line 623. in /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/web/Response.php:373
Stack trace:
#0 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/web/Response.php(346): yii\web\Response->sendHeaders()
#1 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/base/Application.php(662): yii\web\Response->send()
#2 /home/hicefuvo/www/spherene/sphereneV1/vendor/nfourtythree/vcard/src/controllers/DefaultController.php(66): yii\base\Application->end()
#3 [internal function]: nfourtythree\vcard\controllers\DefaultController->actionIndex('-UVmaAHv4kdlP-C...')
#4 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#5 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#6 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/base/Module.php(534): yii\base\Controller->runAction('index', Array)
#7 /home/hicefuvo/www/spherene/sphereneV1/vendor/craftcms/cms/src/web/Application.php(287): yii\base\Module->runAction('vcard/default/i...', Array)
#8 /home/hicefuvo/www/spherene/sphereneV1/vendor/craftcms/cms/src/web/Application.php(596): craft\web\Application->runAction('vcard/default/i...', Array)
#9 /home/hicefuvo/www/spherene/sphereneV1/vendor/craftcms/cms/src/web/Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#10 /home/hicefuvo/www/spherene/sphereneV1/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 /home/hicefuvo/www/spherene/sphereneV1/web/index.php(21): yii\base\Application->run()
#12 {main}</pre>
Then I generate a new vCard without any image, I don't get an error.
This is my Code:
{% set vcardTeam = siteUrl ~ craft.imager.transformImage(entry.portraitImage.one, { width: 250, height: 250, format: 'jpg' }) %}
{% set vcardAddress = gloAddress.addressStreet ~ ' ' ~ gloAddress.addressNr %}
{% set options = {
photo: vcardTeam,
firstName: entry.firstname,
lastName: entry.lastname,
prefix: entry.salutation,
company: gloAddress.company,
jobTitle: entry.jobFunction,
url: gloAddress.website,
email: [{ address: entry.eMail, type: "WORK" }, entry.eMail ],
phoneNumber: [ entry.phone, { number: entry.phone }],
address: [{
name: gloAddress.company,
street: vcardAddress,
city: gloAddress.addressCity,
zip: gloAddress.addressZip,
country: 'Schweiz',
type: "WORK;PARCEL;POSTAL"
}],
} %}
Metadata
Metadata
Assignees
Labels
No labels