Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

Bug: Wizard final Create returns 'required properties missing' despite full ApplicationVersion payload #71

Description

@rubenvdlinde

Symptom

After PR #70 fixes the schema-slug uniqueness for the wizard's seed step, clicking Create on the wizard's Review step still fails. OR responds with:

An exception occurred while executing a query: ...
The required properties (name, slug, manifest, register, application) are missing. Please provide values for these properties.

What the payload actually carries

`ApplicationCreationService::createApplicationFromPayload` constructs the version payload at `lib/Service/ApplicationCreationService.php:214-222`:

```php
$versionPayload = [
'name' => $versionName, // 'Development' / 'Production'
'slug' => $versionSlug, // 'development' / 'production'
'manifest' => $versionManifest, // copy of default-manifest with register substituted
'register' => $registerSlug, // 'openbuilt-{appSlug}-{versionSlug}'
'semver' => self::INITIAL_SEMVER, // '0.1.0'
'status' => 'draft',
'application' => $state['applicationUuid'],
];
$created = $this->objectService->saveObject(
object: $versionPayload,
register: ApplicationVersionService::REGISTER_SLUG, // 'openbuilt'
schema: ApplicationVersionService::APPLICATION_VERSION_SCHEMA // 'applicationVersion'
);
```

All 7 required fields per the ApplicationVersion schema at `lib/Settings/openbuilt_register.json` (name, slug, manifest, register, semver, status, application) are populated. Yet OR rejects the save with the 5 of them listed as missing.

Hypotheses (untested)

  1. `application` relation shape mismatch — the ApplicationVersion schema defines `application` as a relation to Application. OR may require the value to be a typed reference object (`{id: ''}` or similar) rather than a bare UUID string.
  2. Named-arg dispatch on saveObject — the wizard calls `saveObject(object: ..., register: ..., schema: ...)` with named args. `ObjectService::saveObject` has `?array $extend=[]` as its 2nd positional param; PHP 8+ should still route the named args correctly, but worth verifying with explicit positional call.
  3. `_rbac` middleware stripping unknown fields — OR's `saveObject` runs the payload through permission/normalisation passes before validation. One of those may be dropping fields that lack a corresponding schema match.

Repro

  1. Pull `fix/openbuilt-wizard-and-data-fetch` + the companion nc-vue branch.
  2. `docker exec nextcloud php occ upgrade && docker exec nextcloud apache2ctl graceful`
  3. Navigate to `/apps/openbuilt/applications`, click Add application.
  4. Fill name "Test App", click Next.
  5. Pick Development + Production preset, click Next.
  6. On Review screen, click Create.
  7. Wizard shows error banner with the message above.

Investigation steps

  1. `docker exec nextcloud tail -200 /var/www/html/data/nextcloud.log` — but the noisy `/apps/openbuilt/img/app.svg` 404s (related to issue Bug: Icon endpoint /apps/openbuilt/icons/{slug}.svg returns 404 #68) may bury the actual stack trace. Filter on `reqId` of the POST request.
  2. Add temporary `error_log()` calls in `ApplicationCreationService::createApplicationFromPayload` to dump the payload right before `saveObject`.
  3. Test with positional args:
    ```php
    $this->objectService->saveObject($versionPayload, [], ApplicationVersionService::REGISTER_SLUG, ApplicationVersionService::APPLICATION_VERSION_SCHEMA);
    ```
  4. If that doesn't help, test with `{id: $applicationUuid}` for the `application` field instead of a bare string.

Surfaced by

Visual smoke during the morning verification pass of the merged ADR-002 chain. See `docs/tutorials/create-a-virtual-app.md` in PR #70 for the wizard walkthrough; this issue is the blocker preventing successful end-to-end app creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions