Skip to content
Snippets Groups Projects

3325447-Warning-Upon-creating-new-transaction

1 file
+ 6
4
Compare changes
  • Side-by-side
  • Inline
@@ -680,10 +680,12 @@ class EtTransaction extends ContentEntityBase implements EtTransactionInterface
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
foreach ($this->choice as $choice_item) {
if ($choice_item->entity && $choice_item->entity->needsSaving()) {
$choice_item->entity->save();
$choice_item->target_id = $choice_item->entity->id();
if (!empty($this->choice)) {
foreach ($this->choice as $choice_item) {
if ($choice_item->entity && $choice_item->entity->needsSaving()) {
$choice_item->entity->save();
$choice_item->target_id = $choice_item->entity->id();
}
}
}
Loading