Skip to content

Developer manual: fix the attribute and CSP examples in controllers.rst #15679

Description

@miaulalala

Two code examples in developer_manual/basics/controllers.rst don't work as written, and one attribute is missing from the list.

  • Attributes example (around line 909): imports PublicPage but uses #[NoAdminRequired]. Import OCP\AppFramework\Http\Attribute\NoAdminRequired (and drop the unused import).
  • CSP example (around line 1153): $csp->addAllowedImageDomain('*'); ends with ;, so the next ->addAllowedMediaDomain('*'); is a syntax error, and index() never returns $response. Fix the chain and add return $response;.
  • Add #[PasswordConfirmationRequired] to the list of controller attributes, with a one-line explanation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions