Skip to content

Commit 736c8cc

Browse files
Fix Array to string conversion error
Without this fix, I was getting the following error: ``` Notice: Array to string conversion in /Users/paulrobertlloyd/Sites/bradshawsguide/site/plugins/alphabetise/alphabetise.php on line 21 Notice: Undefined property: Page::$Array in /Users/paulrobertlloyd/Sites/bradshawsguide/site/plugins/alphabetise/alphabetise.php on line 21 Fatal error: Method Kirby\Patterns\Pattern::__toString() must not throw an exception, caught Error: Function name must be a string in /Users/paulrobertlloyd/Sites/bradshawsguide/site/plugins/patterns/lib/helpers.php on line 0 ``` My PHP knowledge is well, non-existent, but enough Googling led me to work out that this change will convert `$options['key']` into a useable string.
1 parent cede269 commit 736c8cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

alphabetise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function alphabetise($parent, $options=array()) {
1919

2020
//Gets the input into a two dimensional array - uses '~' as separator;
2121
foreach ($parent as $item){
22-
$temp = explode('~',$item->$options['key']() );
22+
$temp = explode('~',$item->{$options['key']}() );
2323
$temp = $temp[0];
2424
$temp = strtolower($temp);
2525
$array[$temp][] = $item;

0 commit comments

Comments
 (0)