Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Can someone spot what is wrong here and the controller is not overrides as expected?

Options
U04HZ4BLVMM
U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet

Can someone spot what is wrong here and the controller is not overrides as expected?

Comments

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    Have you refreshed the router cache with vendor/bin/console router:cache:warm-up ?

  • michael.schmetter
    michael.schmetter Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    Maybe you need to run docker/sdk console cache:class-resolver:build

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Both nothing changed

  • michael.schmetter
    michael.schmetter Posts: 119 🧑🏻‍🚀 - Cadet
    Options

    Which URL are you calling?

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    merchant-gui/create-merchant

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    When I create the file is like ok, the controller didn't found. When I create the class inside, it's going to the parent always.

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    I am stack here looking the code, what might be the issue...

  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 🧑🏻‍🚀 - Cadet
    Options

    Have you tried bin/console router:cache:warm-up:backoffice ?

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Yeap, just now. Nothing

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options
    So what I just found is that, if I create     public function __construct()
        {
            dd(
                'here'
            );
        }
    
  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    It's going inside this function in my file

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    but the indexAction is always overridden from the parent indexAction Controller

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    Can you check the files in src/Generated/Router/Backoffice to see which class is defined for that route?

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    If it is wrong try deleting these generated files and the rerunning the warm up commands. We had this the other day when the files did not update for some reason.

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Seems right

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options
    'merchant-gui:create-merchant:index' => [[], ['_controller' => ['Pyz\\Zed\\MerchantGui\\Communication\\Controller\\CreateMerchantController', 'indexAction'], '_template' => 'MerchantGui/CreateMerchant/index'], [], [['text', '/merchant-gui/create-merchant/index']], [], [], []],
    
  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    The indexAction is always overridden from the parent indexAction Controller

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    Yep, looks 100% correct. Composer autoloader? eg composer dump-autoload -o

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    What is this exactly?

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    Sorry I don’t know the Spryker SDK command for this, but the autoloader will map FQCN to files

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    It’s not very likely, but worth a try - it’s just another cache to clear 😉

  • michael.schmetter
    michael.schmetter Posts: 119 🧑🏻‍🚀 - Cadet
    edited February 2023
    Options

    Module is really called MerchantGui? I've seen some customer prefix in your deleted version of that snippet, something with Shopflix

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Yeap MerchantGui is for marketplace about merchants

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Caching shit, i putted docker/sdk reset and it's working

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet
    Options

    Maybe it was a file sync between your host and docker? Either way glad it’s working now, that was very weird!

  • U04PXB4UVU1
    U04PXB4UVU1 Posts: 3 🧑🏻‍🚀 - Cadet
    edited March 2023
    Options

    Hey Chirstos
    please add a SOLVED tag to the thread and the answer it will be helpful for our future sprykees