octobercms/october · error · ApplicationException

Form record with an ID of :id could not be found.

Error message

Form record with an ID of :id could not be found.

What it means

Thrown by the Tailor Entries controller (formFindModelObject) when the requested record ID cannot be found in the database, even after including soft-deleted records via withTrashed(). It surfaces as an ApplicationException, meaning it produces a user-facing error page or AJAX error response rather than a system crash.

Source

Thrown at modules/tailor/controllers/Entries.php:727

            $model = $model->withSites();
        }

        if ($this->isVersionMode()) {
            $model = $model->withVersions();
        }

        if ($this->isDraftMode()) {
            $model = $model->withDrafts();
        }
        else {
            $model = $model->withSavedDrafts();
        }

        // Include deleted records
        $model = $model->withTrashed()->find($recordId);

        if (!$model) {
            throw new ApplicationException(__("Form record with an ID of :id could not be found.", [
                'class' => $this->modelInstance::class, 'id' => $recordId
            ]));
        }

        // Mimic parent method
        $this->formExtendModel($model);

        return $model;
    }

    /**
     * formGetRedirectUrl
     */
    public function formGetRedirectUrl($context = null, $model = null): string
    {
        if (post('close') || $this->isSectionSingular() || $context === 'delete') {
            $url = 'tailor/entries/'.$this->activeSource->handleSlug;
        }

View on GitHub (pinned to b608633a7e)

Solutions

  1. Verify the record exists: check the listing in the Tailor backend section, or run php artisan tinker and query the entry table for that ID
  2. If the URL is stale (old bookmark, reopened tab), navigate back to the section list and open the record fresh
  3. In multisite setups, switch to the site node the record belongs to before editing it
  4. If records were deleted by a migration or import, restore the data or remove the outdated link
Defensive patterns

Strategy: validation

Validate before calling

// Before linking to an entry, confirm it exists (including trashed)
$exists = \Tailor\Models\EntryRecord::inSection('blog_post')
    ->withTrashed()
    ->whereKey($recordId)
    ->exists();
if (!$exists) {
    // skip rendering / redirect to list
}

Try / catch

try {
    $model = $controller->formFindModelObject($recordId);
} catch (\ApplicationException $e) {
    // Record was deleted elsewhere: redirect to the section list with a flash message
    return \Redirect::to(backend_url('tailor/entries/' . $sectionHandle))->withFlashError($e->getMessage());
}

Prevention

When it happens

Trigger: Opening /backend/tailor/entries/update/{id} (or an AJAX handler like onSave, onCommitDraft, onRestore) with an ID that no longer exists; the record was hard-deleted in another tab or by another user; the URL was bookmarked with a stale ID; the record belongs to a different site in a multisite setup and is filtered out.

Common situations: Stale browser tab after the record was deleted elsewhere; double-submit after a delete; copied links to removed entries; multisite deployments where the record exists only on another site node; draft-mode URL quirks where the draft record id differs from the published record id.

Related errors


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/3022e3a90432e3a9. Report an issue: GitHub.