mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8040 from azt3k/patch-3
Fixes a count() php warning without an api change
This commit is contained in:
commit
5a831485bf
@ -1347,6 +1347,12 @@ class Member extends DataObject
|
|||||||
*/
|
*/
|
||||||
public static function mapInCMSGroups($groups = null)
|
public static function mapInCMSGroups($groups = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// non-countable $groups will issue a warning when using count() in PHP 7.2+
|
||||||
|
if (!$groups) {
|
||||||
|
$groups = [];
|
||||||
|
}
|
||||||
|
|
||||||
// Check CMS module exists
|
// Check CMS module exists
|
||||||
if (!class_exists(LeftAndMain::class)) {
|
if (!class_exists(LeftAndMain::class)) {
|
||||||
return ArrayList::create()->map();
|
return ArrayList::create()->map();
|
||||||
|
Loading…
Reference in New Issue
Block a user