Override controller / services not working in Admin Panel V4

System Information
  • Strapi Version: 4.0.2
  • Operating System: Mac OS 12.0.1
  • Database: PostgreSQL 12.2
  • Node Version: 16.13.1
  • NPM Version: 8.1.2
  • Yarn Version: 1.22.17

Hi, when I override a v4 service/controller it works as expected when called with REST/GraphQL api but doesn’t call when I modify the data from Admin Panel.


'use strict';
const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::test.test', ({ strapi, ...rest }) => ({
    async update(ctx) {
        // some logic here
        const response = await super.update(ctx);

        console.log({ response })
        // some more logic

        return response;

From my understanding of what I read of V3, it has something to do with Admin Panel calls custom content-manager services.

Is there a way a controller/service override can apply to both? REST/GraphQL Client & Admin Panel Content Manager?


Did you ever find a solution?

Any update here?

Still nothing?

@xantiagoma So finally I found the way to do it for me. I am not sure the best aproach,but you can do something inside of test/content-types/test/, create a lifecycles.js doc and create a this funcions

module.exports = {

  async afterUpdate(event) {
    // some logic here
    if (
      //compare you new data with old  to avoid infinite loop
      ) {

      await strapi.db.query('api::test.test').update({
        where: { id: event.params.where.id },
        data: {
           // some logic here

hope it helps

Hmm this is not ideal. Controller update should work. Create gets called from admin panel queries but not update which is strange. Update gets called when using the rest api. So it doesnt make sense.

I dont like using the lifecycle for this because in my case the logic should be in the controller.

Depending on the action you do the right lifecycle should be called.
If this is not the cease please open a issue on GitHub

It seems when extending the controllers the update method does not get called so you cannot extend the update method for any controllers. Seems like a flaw.

did you call await super.update(ctx);?

The update method does not get called at all. I have my debugger setup and I added console logs. Update method only gets hit when updating via rest api and does not get hit when updating via admin panel.

I created an issue here: