opensemanticsearch / solr-php-ui

Solr client and user interface for search
https://opensemanticsearch.org/solr-php-ui
GNU General Public License v3.0
21 stars 21 forks source link

type_group may not be a string but an array #75

Open horde3d opened 1 year ago

horde3d commented 1 year ago

In my installation I stumbled over an issue, were type_group was an array which result in strpos throwing an error because it expects a string.

https://github.com/opensemanticsearch/solr-php-ui/blob/4e9ce94f47e48d3882b84f4e8955fe74dae8b0fc/src/templates/view.preview.php#L454

Without further investigations I fixed it by adding a check for is_string

<?php if ( $type == 'CSV row' || (is_string($type_group) && strpos($type_group, 'Knowledge graph') === 0) || strpos($type, 'Knowledge graph') === 0 )