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?

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

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

  • michael.schmetter
    michael.schmetter Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    Both nothing changed

  • michael.schmetter
    michael.schmetter Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

    Which URL are you calling?

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    merchant-gui/create-merchant

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    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

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

  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yeap, just now. Nothing

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet
    So what I just found is that, if I create     public function __construct()
        {
            dd(
                'here'
            );
        }
    
  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    It's going inside this function in my file

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    but the indexAction is always overridden from the parent indexAction Controller

  • UKEP86J66
    UKEP86J66 Posts: 208 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • UKEP86J66
    UKEP86J66 Posts: 208 πŸ§‘πŸ»β€πŸš€ - Cadet

    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

    Seems right

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet
    '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

    The indexAction is always overridden from the parent indexAction Controller

  • UKEP86J66
    UKEP86J66 Posts: 208 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

    What is this exactly?

  • UKEP86J66
    UKEP86J66 Posts: 208 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • UKEP86J66
    UKEP86J66 Posts: 208 πŸ§‘πŸ»β€πŸš€ - Cadet

    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

    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

    Yeap MerchantGui is for marketplace about merchants

  • U04HZ4BLVMM
    U04HZ4BLVMM Posts: 69 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • UKEP86J66
    UKEP86J66 Posts: 208 πŸ§‘πŸ»β€πŸš€ - Cadet

    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

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