massiveart / MassiveSearchBundle

MIT License
67 stars 24 forks source link

Fix MassiveSearchExpressionLanguage with object/stdClass for block settings #175

Closed popoplanter closed 7 months ago

popoplanter commented 7 months ago

Fixes search reindex for ArticleDocument and PageDocument by catching NoSuchIndexException

alexander-schranz commented 7 months ago

Settings when empty are a \stdClass this currently required because how JSON Serializer works as empty array is converted to [] but the frontend expect an object {} for the Sulu JADMIN and so it is \stdClass which seems to fail currently in the massive search bundle property accessor. The NoSuchIndexException is throw when tried access a object by array selectors. This way we avoid currently this error and return the default value. /cc @wachterjohannes

wachterjohannes commented 7 months ago

@popoplanter the change seems legit! but please fix php-cs