responsiv / campaign-plugin

[PREMIUM] Send professional campaign messages to your subscribers.
http://octobercms.com/plugin/responsiv-campaign
5 stars 2 forks source link

Error when duplicating a campaign #48

Closed smartscripts-nl closed 4 years ago

smartscripts-nl commented 6 years ago

When I duplicate a campaign, I receive this error message in a popup: "Illegal offset type". The new campaign is created nontheless.

In the log I see an entry reflecting this error:

[2017-11-15 13:19:35] production.ERROR: ErrorException: Illegal offset type in [path-to-october-folder]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php:139

smartscripts-nl commented 6 years ago

If required, I can send a full stack trace.

datune commented 5 years ago

@daftspunk This error still persists to this day. Can you please update your plugin?

joebuonocore commented 5 years ago

Ran into this today, but I haven't figured out a real solution.

Seems to be centric to the duplicating of the message-list pivot records. Commenting out line 218 in the Message model duplicates with no error message.

If I can come up with a better fix at a later date, I will update here.

Johardmeier commented 4 years ago

Still a Problem.

daftspunk commented 4 years ago

Thanks. Will take a look soon

daftspunk commented 4 years ago

This was a complex issue introduced in the October library some time ago, it has been fixed in https://github.com/octobercms/library/commit/9210441cee275e731bd98e4a8db334ba4fdcc4fd and will be available in build 465+

A backwards compatibility fix has also been introduced in v1.2.4 of the campaign plugin. You may now update to receive the fix. Which was to change this line in the duplicateCampaign function of the Message model:

$model->subscriber_lists = $this->subscriber_lists->all();

Thanks for your patience with this issue!