Found while reviewing the beta release PR #1026 (head ae22b32).
#1026 adds module and catalogService to MergeOrganisatieService::FIELD_RELATION_TYPES (and the matching ownership entries), so a merged-away supplier's applications and services move to the target. All of them are collected through findAllForType() (lib/Service/MergeOrganisatieService.php:799), which calls:
$objectService->findAll(config: ['_register' => …, '_schema' => …, 'limit' => 10000]);
OpenRegister's ObjectService::prepareFindAllConfig() only reads filters.register / filters.schema (openregister/lib/Service/ObjectService.php:1522,1530) and otherwise uses the current register/schema context. Without a context MagicMapper::findAll() logs a warning and returns []; with a context left over from an earlier call it returns the wrong schema's objects. _rbac / _multitenancy also default to true, which limits results to the admin's active organisation.
Impact: the merge reports 0 re-pointed modules/services, tombstones the source organisation, and leaves its applications pointing at the merged-away supplier. The root cause also affects the pre-existing relation types. The unit test doesn't catch it because its mock keys on $config['_schema'] (tests/Unit/Service/MergeOrganisatieServiceTest.php:740).
Suggested fix: $objectService->setRegister($registerId)->setSchema($schemaId)->findAll(['limit' => …], _rbac: false, _multitenancy: false) (or searchObjects with @self.register / @self.schema plus a filter on the relation field), paginate instead of capping at 10000, and make the test mock fail on unknown config keys.
Found while reviewing the beta release PR #1026 (head
ae22b32).#1026 adds
moduleandcatalogServicetoMergeOrganisatieService::FIELD_RELATION_TYPES(and the matching ownership entries), so a merged-away supplier's applications and services move to the target. All of them are collected throughfindAllForType()(lib/Service/MergeOrganisatieService.php:799), which calls:OpenRegister's
ObjectService::prepareFindAllConfig()only readsfilters.register/filters.schema(openregister/lib/Service/ObjectService.php:1522,1530) and otherwise uses the current register/schema context. Without a contextMagicMapper::findAll()logs a warning and returns[]; with a context left over from an earlier call it returns the wrong schema's objects._rbac/_multitenancyalso default to true, which limits results to the admin's active organisation.Impact: the merge reports 0 re-pointed modules/services, tombstones the source organisation, and leaves its applications pointing at the merged-away supplier. The root cause also affects the pre-existing relation types. The unit test doesn't catch it because its mock keys on
$config['_schema'](tests/Unit/Service/MergeOrganisatieServiceTest.php:740).Suggested fix:
$objectService->setRegister($registerId)->setSchema($schemaId)->findAll(['limit' => …], _rbac: false, _multitenancy: false)(orsearchObjectswith@self.register/@self.schemaplus a filter on the relation field), paginate instead of capping at 10000, and make the test mock fail on unknown config keys.