You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I clone/duplicate an entry, and then try and publish a draft from that cloned entry I get the following error:
PHP Notice – yii\base\ErrorException
Trying to get property 'id' of non-object
1. in /app/cms/vendor/besteadfast/craft-preparse-field/src/PreparseField.phpat line 118
function (ElementEvent $event) {
if ($event->element->getIsRevision()) {
return;
}
if ($event->element->getId()) {
// Since it's already been saved, we need to fetch the element again.
/** @var Element $element */
$element = Craft::$app->elements->getElementById($event->element->getId(), null, $event->element->siteId);
$key = $element->id . '__' . $element->siteId;
if (!isset($this->preparsedElements['onSave'][$key])) {
$this->preparsedElements['onSave'][$key] = true;
// Still pass the event element here to generate the preparse fields content, not the $element fetched above.
$content = self::$plugin->preparseFieldService->getPreparseFieldsContent($event->element, 'onSave');
if (!empty($content)) {
$this->resetUploads();
I've seen the Trying to get property 'id' of non-object mentioned in a few other recent issues. Any idea how to fix?
The text was updated successfully, but these errors were encountered:
Hey, just wanted to let you know that we've found a potential solution for this; just want to do some testing and maybe get some additional eyes on it from some people that are much smarter than I am so we don't cause a regression for #66. Look for something early next week 🤞
Craft 3.6.11.1, Preparse 1.2.4
If I clone/duplicate an entry, and then try and publish a draft from that cloned entry I get the following error:
I've seen the
Trying to get property 'id' of non-object
mentioned in a few other recent issues. Any idea how to fix?The text was updated successfully, but these errors were encountered: