Skip to content

Commit

Permalink
fix: disabled project config listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanie Gevaert committed Oct 25, 2022
1 parent b9eef31 commit d07f3ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 4.0.1 - 2022-10-25
### Fix
- Fixed: the project rebuild command was failing because of project config settings, these were disabled since we don't use them yet

## 4.0.0 - 2022-10-06
### Added
- Added: A sync console command
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "percipiolondon/craft-typesense",
"description": "Craft Plugin that synchronises with Typesense",
"type": "craft-plugin",
"version": "4.0.0",
"version": "4.0.1",
"keywords": [
"craft",
"cms",
Expand Down
18 changes: 9 additions & 9 deletions src/Typesense.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,17 @@ protected function customAdminCpPermissions(): array
*/
private function _registerProjectConfigEventListeners()
{
$projectConfigService = Craft::$app->getProjectConfig();
// $projectConfigService = Craft::$app->getProjectConfig();

$collectionService = self::$plugin->getCollections();
$projectConfigService
->onAdd(CollectionService::CONFIG_COLLECTIONS_KEY, [$collectionService, 'handleChangedCollection'])
->onUpdate(CollectionService::CONFIG_COLLECTIONS_KEY, [$collectionService, 'handleChangedCollection'])
->onRemove(CollectionService::CONFIG_COLLECTIONS_KEY, [$collectionService, 'handleDeletedCollection']);
// $collectionService = self::$plugin->getCollections();
// $projectConfigService
// ->onAdd(CollectionService::CONFIG_COLLECTIONS_KEY, [$collectionService, 'handleChangedCollection'])
// ->onUpdate(CollectionService::CONFIG_COLLECTIONS_KEY, [$collectionService, 'handleChangedCollection'])
// ->onRemove(CollectionService::CONFIG_COLLECTIONS_KEY, [$collectionService, 'handleDeletedCollection']);

Event::on(ProjectConfig::class, ProjectConfig::EVENT_REBUILD, function(RebuildConfigEvent $event) {
$event->config['typesense'] = ProjectConfigDataHelper::rebuildProjectConfig();
});
// Event::on(ProjectConfig::class, ProjectConfig::EVENT_REBUILD, function(RebuildConfigEvent $event) {
// $event->config['typesense'] = ProjectConfigDataHelper::rebuildProjectConfig();
// });
}

/**
Expand Down

0 comments on commit d07f3ed

Please sign in to comment.