riasvdv / statamic-collection-groups

Group your collections into separate groups
3 stars 1 forks source link

Broken with Statamic 3.3+ #3

Open revmitcz opened 1 year ago

revmitcz commented 1 year ago

Followed the exact instructions on a fresh Statamic install (for testing) and used the default structure, but getting the error Call to a member function title() on null (View: ***/vendor/statamic/cms/resources/views/layout.blade.php)

Details :

Here is the exact content of my collection-groups.php file (if I remove everything from within the return call, no error is thrown) :


/**
 * This is where you can define your collection groups.
 * It should have this structure:
 * [
 *     'Group 1 label' => [
 *         'collection_handle_1',
 *         'collection_handle_2',
 *     ],
 *     'Group 2 label' => [
 *         'collection_handle_3',
 *         'Custom Label' => 'collection_handle_4',
 *     ]
 * ]
 */
return [
    'Group 1 label' => [
        'collection_handle_1',
        'collection_handle_2',
    ],
    'Group 2 label' => [
        'collection_handle_3',
        'Custom Label' => 'collection_handle_4',
    ]
];
riasvdv commented 1 year ago

Are you sure the collection handle was correct? Seems like it can't retrieve the collection, hence why it's calling ->title() on null