We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
siteId
After updating to v3.3.1, I get this error when attempting to access Utilities > Scout Indices:
foreach() argument must be of type array|object, int given
The stack trace refers to line 44 in ScoutUtility.php.
ScoutUtility.php
foreach ($engine->scoutIndex->criteria->siteId as $id) { $sites[] = Craft::$app->getSites()->getSiteById($id); }
Here's my scout.php:
scout.php
function createIndices(): array { $sites = Craft::$app->getSites()->getSitesByGroupId(1); $baseLocationIndex = App::parseEnv('$ALGOLIA_LOCATION_INDEX_BASE'); $baseProviderIndex = App::parseEnv('$ALGOLIA_PROVIDER_INDEX_BASE'); $indices = []; foreach ($sites as $site) { $siteId = $site->id; $siteLanguage = $site->language; $indices[] = ScoutIndex::create($baseLocationIndex . '_' . $siteLanguage) ->criteria(function(EntryQuery $query) use ($siteId) { return $query ->sectionId(8) ->siteId($siteId); }) ->transformer(new AlgoliaLocationTransformer([ 'siteId' => $siteId, 'siteLanguage' => $siteLanguage, ])); $indices[] = ScoutIndex::create($baseProviderIndex . '_' . $siteLanguage) ->criteria(function(EntryQuery $query) use ($siteId) { return $query ->sectionId(9) ->siteId($siteId); }) ->transformer(new AlgoliaProviderTransformer([ 'siteId' => $siteId, 'siteLanguage' => $siteLanguage, ])); } return $indices; } return [ 'sync' => false, 'queue' => true, 'connect_timeout' => 1, 'batch_size' => 1000, 'indexRelations' => true, 'application_id' => App::parseEnv('$ALGOLIA_APPLICATION_ID'), 'admin_api_key' => App::parseEnv('$ALGOLIA_ADMIN_API_KEY'), 'search_api_key' => App::parseEnv('$ALGOLIA_SEARCH_API_KEY'), 'indices' => createIndices(), ];
The text was updated successfully, but these errors were encountered:
Fix & tests for #284
9c0e70e
Thanks for catching that @chrismlusk, pushed a fixed and I'll have release out shortly!
Sorry, something went wrong.
Released in 3.3.2, can you give that a go? Feel free to reopen this issue should you still have an issue!
Perfect! Thanks for the quick fix.
No branches or pull requests
After updating to v3.3.1, I get this error when attempting to access Utilities > Scout Indices:
The stack trace refers to line 44 in
ScoutUtility.php
.Here's my
scout.php
:The text was updated successfully, but these errors were encountered: