verbb / events

Craft CMS Plugin for events management and ticketing.
Other
22 stars 12 forks source link

Setting unknown property: craft\commerce\events\PdfEvent::order #122

Closed paulgoodfield closed 1 year ago

paulgoodfield commented 1 year ago

Describe the bug

We recently upgraded a site to use Commerce 4 and version 2 of this plugin. Now, when a user clicks on the link to view their PDF tickets (generated by craft.events.getOrderPdfUrl(order)) we are seeing the above error.

Here is the stacktrace:

yii\base\UnknownPropertyException: Setting unknown property: craft\commerce\events\PdfEvent::order in /app/craft/vendor/yiisoft/yii2/base/BaseObject.php:163
Stack trace:
#0 /app/craft/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\BaseObject->__set('order', Object(craft\commerce\elements\Order))
#1 /app/craft/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\commerce\events\PdfEvent), Array)
#2 /app/craft/vendor/verbb/events/src/services/Pdf.php(66): yii\base\BaseObject->__construct(Array)
#3 /app/craft/vendor/verbb/events/src/controllers/DownloadsController.php(72): verbb\events\services\Pdf->renderPdf(Object(verbb\events\elements\db\PurchasedTicketQuery), Object(craft\commerce\elements\Order), NULL, '')
#4 [internal function]: verbb\events\controllers\DownloadsController->actionPdf()
#5 /app/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#6 /app/craft/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#7 /app/craft/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('pdf', Array)
#8 /app/craft/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('events/download...', Array)
#9 /app/craft/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('events/download...', Array)
#10 /app/craft/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#11 /app/craft/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#12 /app/craft/web/index.php(14): yii\base\Application->run()
#13 {main}

Steps to reproduce

  1. Install Commerce 4 and version 2 of this plugin.
  2. When clicking on the link generated by craft.events.getOrderPdfUrl(order) you will see the above error

Craft CMS version

4.3.10

Plugin version

2.0.0-beta.9

Multi-site?

Yes

Additional context

List of other plugins installed:

AsyncQueue 3.1.0 Category Groups Field 2.0.1 Colour Swatches 4.2.1 Cookies 4.0.0 Craft Commerce 4.2.5.1 Disqus 4.0.0 Element API 3.0.1.1 Environment Label 4.0.2 Events 2.0.0-beta.9 Freeform 4.0.17 Navigation 2.0.16 oEmbed 2.3.0 PDF Transform 2.0.1 Read Only 1.0.5 Redactor 3.0.3 Redirect Manager 2.0.0 Section Field 2.0.1 SEOmatic 4.0.20 Stripe for Craft Commerce 3.1.0 Super Table 3.0.7 Tags 2.0.0 User Group Field 3.0.1

engram-design commented 1 year ago

Should be fixed for the next release. To get this early, run composer require verbb/events:"dev-craft-4 as 2.0.0-beta.9".

paulgoodfield commented 1 year ago

@engram-design Great thanks - that seems to work