responsiv / campaign-plugin

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

Can't create a new campaign on OctoberCMS build 420 #42

Closed Fl0Cri closed 7 years ago

Fl0Cri commented 7 years ago

I started using this plugin on a dev site running build 420 of OctoberCMS.

I tested basic features and noticed that it isn't possible to create a new campaign. I get this error:

Trying to get property of non-object" on line 76 of /plugins/responsiv/campaign/models/MessageStatus.php

This is because the callback passed to the first() method of Laravel collections have not the same order of parameters (from Laravel 5.3): https://laravel.com/docs/5.2/collections#method-first https://laravel.com/docs/master/collections#method-first

In my case I just swapped the parameters of the callback on line 75 of the /plugins/responsiv/campaign/models/MessageStatus.php file.

I can't tell if there are more thing to fix for Laravel 5.5 but it's the only one I found for now.

daftspunk commented 7 years ago

Yes you're right, update line 75 to

return self::listAll()->first(function($status, $key) use ($code) {

This will be addressed in v1.1.24+