The joinWith() query method has been removed

Release Note 2

Recently it was discovered that the groupBy() method in Laravel is flawed, not at any fault of Laravel itself but because of the inability of all SQL drivers, except MySQL, from counting grouped records.

To cut a long story short, the joinWith() method -- unique to October -- is being removed to keep things simple and align with the Laravel way. If you use this method in your plugins, it should be substituted with the whereHas() method found in Laravel. Here is an example of a conversion:

 * Before

$model->joinWith('posts', false);
$model->searchWhere($search, ['rainlab_forum_topics.subject', 'rainlab_forum_posts.subject', 'content']);

// Grouping due to the joinWith() call

 * After

$model->orWhereHas('posts', function($query) use ($search){
    $query->searchWhere($search, ['subject', 'content']);

$model->orSearchWhere($search, 'subject');

Sorry for any inconvenience, if you are affected by this feel free to reach out for support in converting your code.

Related issues

comments powered by Disqus