Skip to content

Commit 4aec4d0

Browse files
author
Conduction Release Bot
committed
Merge development: the truncated @SPEC anchor landed upstream as c130aa2
The anchor commit on this branch is now redundant. Merging development in makes it a no-op, so the PR diff shows only the metadata change this PR is about.
2 parents 44f7a97 + c130aa2 commit 4aec4d0

16 files changed

Lines changed: 1307 additions & 8 deletions

File tree

lib/AppInfo/Application.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
use OCA\OpenRegister\Service\ObjectSource\FederatedObjectSourceProvider;
223223
use OCA\OpenRegister\Service\ObjectSource\FilesObjectSourceProvider;
224224
use OCA\OpenRegister\Service\ObjectSource\GroupObjectSourceProvider;
225+
use OCA\OpenRegister\Service\ObjectSource\OrganisationObjectSourceProvider;
225226
use OCA\OpenRegister\Service\ObjectSource\ObjectSourceRegistry;
226227
use OCA\OpenRegister\Service\ObjectSource\TablesColumnMapper;
227228
use OCA\OpenRegister\Service\ObjectSource\TablesObjectSourceProvider;
@@ -1474,6 +1475,18 @@ function (ContainerInterface $container) {
14741475
}
14751476
);
14761477

1478+
$context->registerService(
1479+
OrganisationObjectSourceProvider::class,
1480+
function (ContainerInterface $container) {
1481+
return new OrganisationObjectSourceProvider(
1482+
organisationMapper: $container->get('OCA\OpenRegister\Db\OrganisationMapper'),
1483+
userSession: $container->get('OCP\IUserSession'),
1484+
groupManager: $container->get('OCP\IGroupManager'),
1485+
logger: $container->get('Psr\Log\LoggerInterface')
1486+
);
1487+
}
1488+
);
1489+
14771490
$context->registerService(
14781491
ContactsObjectSourceProvider::class,
14791492
function (ContainerInterface $container) {
@@ -4436,6 +4449,7 @@ private function bootObjectSourceProviders($server): void {
44364449
CalDavVtodoObjectSourceProvider::class,
44374450
UserDirectoryObjectSourceProvider::class,
44384451
GroupObjectSourceProvider::class,
4452+
OrganisationObjectSourceProvider::class,
44394453
ContactsObjectSourceProvider::class,
44404454
CalendarEventObjectSourceProvider::class,
44414455
FilesObjectSourceProvider::class,

lib/Repair/SeedDirectoryVirtualSchemas.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ class SeedDirectoryVirtualSchemas implements IRepairStep {
6767
'id' => ['type' => 'string', 'title' => 'Group ID', 'description' => 'The Nextcloud group id (gid).'],
6868
'displayName' => ['type' => 'string', 'title' => 'Display name', 'description' => 'The group display name.'],
6969
],
70+
// The identity facet of an OpenRegister organisation, and nothing else.
71+
// This set MUST stay in step with
72+
// {@see \OCA\OpenRegister\Service\ObjectSource\OrganisationObjectSourceProvider}'s
73+
// projection: a property declared here and not projected reads as
74+
// permanently empty, and one projected but not declared is discarded by
75+
// the store without a word.
76+
//
77+
// Tenancy administration (quota, users, groups, authorization) is
78+
// deliberately absent. This schema exists so another record can REFERENCE
79+
// an organisation, not so anyone can configure one through the object API.
80+
'nc-organisation' => [
81+
'id' => ['type' => 'string', 'title' => 'Organisation ID', 'description' => 'The organisation uuid.'],
82+
'name' => ['type' => 'string', 'title' => 'Name', 'description' => 'The organisation name.'],
83+
'description' => ['type' => 'string', 'title' => 'Description', 'description' => 'A description of the organisation.'],
84+
'summary' => ['type' => 'string', 'title' => 'Summary', 'description' => 'A short summary.'],
85+
'oin' => ['type' => 'string', 'title' => 'OIN', 'description' => 'Organisatie-identificatienummer.'],
86+
'tooi' => ['type' => 'string', 'title' => 'TOOI', 'description' => 'TOOI register identifier.'],
87+
'rsin' => ['type' => 'string', 'title' => 'RSIN', 'description' => 'Rechtspersonen en Samenwerkingsverbanden Informatienummer.'],
88+
'kvk' => ['type' => 'string', 'title' => 'KVK', 'description' => 'Chamber of Commerce number.'],
89+
'pki' => ['type' => 'string', 'title' => 'PKI', 'description' => 'PKIoverheid certificate identifier.'],
90+
'image' => ['type' => 'string', 'title' => 'Image', 'description' => 'A logo or image URL.'],
91+
'type' => ['type' => 'string', 'title' => 'Type', 'description' => 'What kind of organisation this row describes.'],
92+
'registrationStatus' => ['type' => 'string', 'title' => 'Registration status', 'description' => 'Registration lifecycle state.'],
93+
],
7094
];
7195

7296
/**

lib/Service/Deferral/ListenerDeferralService.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ private function captureActor(): void {
311311
/**
312312
* Register the shutdown flush exactly once per request.
313313
*
314+
* The callback is a closure calling `flushAll()` rather than the
315+
* `[$this, 'flushAll']` array form it replaced. A string method name is
316+
* invisible to every static tool: a rename of `flushAll()` leaves the
317+
* array callable pointing at nothing and fails only at shutdown, where
318+
* nothing observes it — the deferred jobs would simply stop being
319+
* enqueued, silently. The closure makes the call site greppable and
320+
* rename-safe, and matches ObjectEventProxyListener::traceEnabled().
321+
*
314322
* @return void
315323
*/
316324
private function hookShutdown(): void {
@@ -319,6 +327,10 @@ private function hookShutdown(): void {
319327
}
320328

321329
$this->shutdownHooked = true;
322-
register_shutdown_function([$this, 'flushAll']);
330+
register_shutdown_function(
331+
function (): void {
332+
$this->flushAll();
333+
}
334+
);
323335
}//end hookShutdown()
324336
}//end class

lib/Service/Object/SearchQueryHandler.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,17 @@ public function logSearchTrail(
664664

665665
// Register the deferred flush once per request; it runs after the
666666
// response has been generated so the write cost is off the hot path.
667+
// The callback is a closure rather than the `[$this, 'flushSearchTrails']`
668+
// array form it replaced: a string method name is invisible to every
669+
// static tool, so renaming the flush would break the registration with
670+
// no error anywhere — trails would just stop being written.
667671
if ($this->trailFlushRegistered === false) {
668672
$this->trailFlushRegistered = true;
669-
register_shutdown_function([$this, 'flushSearchTrails']);
673+
register_shutdown_function(
674+
function (): void {
675+
$this->flushSearchTrails();
676+
}
677+
);
670678
}
671679
}//end logSearchTrail()
672680

lib/Service/ObjectSource/NcEntitySemanticMap.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ final class NcEntitySemanticMap {
8484
'requiredApp' => null,
8585
'application' => 'openregister',
8686
],
87+
// OpenRegister's own organisation, projected so a leaf schema can point a
88+
// `{"$ref": ...}` at it. Several apps declared their own `organization`
89+
// SCHEMA precisely because there was nothing here to reference, and a
90+
// schema slug is global per organisation, so those copies collide.
91+
//
92+
// `nc-`-prefixed for the reason the app-gated rows below are: it must not
93+
// collide with the leaf-app `organization` schemas it exists to replace,
94+
// which have to keep working until each app has migrated off them.
95+
'organisation' => [
96+
'register' => self::DIRECTORY_REGISTER,
97+
'schema' => 'nc-organisation',
98+
'schemaOrg' => 'schema:Organization',
99+
'provider' => 'organisation-source',
100+
'requiredApp' => null,
101+
'application' => 'openregister',
102+
],
87103
// App-gated rows — each lives on its OWN app-named register (application =
88104
// register slug) so the ADR-048 app-enabled gate degrades the projection
89105
// when the backing app is uninstalled. Schemas are `nc-`-prefixed to avoid

0 commit comments

Comments
 (0)