Skip to content

Controller update method is not called from the admin panel #18214

@gregg-cbs

Description

@gregg-cbs

Bug report

Required System information

  • Strapi version: 4.13.6
  • Database: Postgres
  • Operating system:

Describe the bug

When extending a controllers update method, the method is called via rest api but not when updating content in the admin panel.

Steps to reproduce the behavior

  1. Create a collection in the admin panel
  2. Add update method to the collections controller in code
  3. Create content in the collection and then update some content in the admin panel
  4. Notice the update method does not fire
  5. Make a PUT rest api request to the route and notice the update method does fire

Expected behavior

Expect the update controller to run anytime content is updated. Not only via specific entry points like rest api.

Code snippets

export default factories.createCoreController('api::event.event', ({ strapi }) => ({
    async update(ctx){
      console.log("Does not run when saving content in the admin panel")
   }
}))

Additional context

Forum discussion raised by other members here https://forum.strapi.io/t/override-controller-services-not-working-in-admin-panel-v4/13997

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: will not fixWon't fix as it's either intended or for some other reason

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions