Merge pull request #242 from chrometoasters/pulls/fix-241-list-of-classes

FIX #241 - Support numerically indexed array of classes
This commit is contained in:
Dylan Wagstaff 2018-12-04 21:40:20 +13:00 committed by GitHub
commit d92f4d64cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,6 +186,11 @@ abstract class SearchVariant
// Construct new array of variants applicable to at least one class in the list
$commonVariants = [];
foreach ($classes as $class => $options) {
// BC for numerically indexed list of classes
if (is_numeric($class) && !empty($options['class'])) {
$class = $options['class']; // $options['class'] is assumed to exist throughout the code base
}
// Extract relevant class options
$includeSubclasses = isset($options['include_children']) ? $options['include_children'] : true;