octobercms/october · error · ApplicationException

backend::lang.form.missing_id

Error message

backend::lang.form.missing_id

What it means

formFindModelObject throws the localized backend::lang.form.missing_id error when an update-style action requests a model object but $recordId is empty — the route/URL is missing the record identifier segment.

Solutions

  1. Ensure update/delete URLs include the record ID parameter
  2. Check route parameter names match the controller action's expected :id
  3. Guard the link generation that builds the edit URL
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/behaviors/FormController.php:851 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at modules/backend/behaviors/FormController.php:851

        $foundKey = $this->getConfig("permissions[{$name}]");

        return $foundKey ? BackendAuth::userHasAccess($foundKey) : true;
    }

    //
    // Overrides
    //

    /**
     * formFindModelObject finds a Model record by its primary identifier, used by update
     * actions. This logic can be changed by overriding it in the controller.
     * @param string $recordId
     * @return Model
     */
    public function formFindModelObject($recordId)
    {
        if (!strlen($recordId)) {
            throw new ApplicationException($this->getCustomLang('notFound', 'backend::lang.form.missing_id'));
        }

        $model = $this->controller->formCreateModelObject();

        // Prepare query and find model record
        $query = $model->newQuery();

        // Remove multisite restriction
        if ($this->controller->formHasMultisite($model)) {
            $query->withSites();
        }
        elseif ($this->controller->formHasMultisiteGroup($model)) {
            $query->withSiteGroups();
        }

        $this->controller->formExtendQuery($query);
        $result = $query->find($recordId);

View on GitHub (pinned to b608633a7e)