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..

Hey team, I have been stuck on this problem for too long. We have our module is not in "spryker-b2c/

Options
U04949W9DJ8
U04949W9DJ8 Posts: 19 🧑🏻‍🚀 - Cadet
edited April 2023 in Help

Hey team, I have been stuck on this problem for too long.
We have our module is not in "spryker-b2c/src/Pyz/Zed". It is our own directory, "our-directory/src/Directory/Zed". Our project requires us to change our Directory name.

However, when changing our name from "Directory" to anything else, the file "Zed/Router/codeBucketUS/Pyz/url_generating_routes.php"
no longer generates a route for our module.

Because of that, we get the error: Symfony\Component\HttpKernel\Exception\NotFoundHttpException - No route found for "POST <our module's URL route>"

My question is, why does Spryker no longer generate routes for our module when we change the name of the namespace? Is there a fix for this, and if so, where can we configure that?

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    edited April 2023
    Options

    Hey, stupid question but just to be sure: When you changed the folder-name you also updated the config_default.php, right? (and maybe composer autoload-dump)

  • U04949W9DJ8
    U04949W9DJ8 Posts: 19 🧑🏻‍🚀 - Cadet
    Options

    Yep! I changed the name in the core namespaces.

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    Options

    core namespaces? Should imo be in

    $config[KernelConstants::PROJECT_NAMESPACES]
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    Options
    • you also executed docker/sdk console cache:empty-all right?
  • U04949W9DJ8
    U04949W9DJ8 Posts: 19 🧑🏻‍🚀 - Cadet
    Options

    Yes I did. Also, putting our directory namespace in project namespaces breaks our original code

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    Options

    but it worked with the previous name or is it the first time you want to use something other than “Pyz” ?

  • U04949W9DJ8
    U04949W9DJ8 Posts: 19 🧑🏻‍🚀 - Cadet
    Options

    We have a previous name other than "Pyz" that does work. We need to change it again but once we do, our Zed route is no longer generated

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)
    Options

    ok hm. strange. I can not debug it by myself before Thursday.

    Just one last idea: try docker/sdk console cache:class-resolver:build
    or docker/sdk console router:cache:warm-up:backoffice

  • U04949W9DJ8
    U04949W9DJ8 Posts: 19 🧑🏻‍🚀 - Cadet
    Options

    Unfortunately that did not work. I appreciate your time. I'll keep taking a look at it

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 🧑🏻‍🚀 - Cadet
    Options

    If you wanna use your own vendor, you have to add it to many classes on Pyz. Some examples KernelConfig, PropelConfig, RouterConfig (this could be your problem), SearchElasticSerachConfig, TransferConfig, TranslatorConfig, TwigConfig, ZedNavigationConfig and also you have to add the namespace the shop config

  • U04949W9DJ8
    U04949W9DJ8 Posts: 19 🧑🏻‍🚀 - Cadet
    Options

    The solution was to add the path to getControllerDirectories() in RouterConfig. Thank you everyone for the help!