To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #303 (closed defect: fixed)

Opened 22 months ago

Last modified 21 months ago

apostrophePlugin's routing.yml is interfering with non-Apostrophe apps, should register via PHP

Reported by: boutell Owned by: boutell
Priority: major Milestone: 1.4
Component: apostrophePlugin Version: 1.0
Keywords: routing Cc:
Symfony version: 1.4

Description

OK, I see it now.

There is an engine route in our routing.yml (a_admin). Engine routes check for an engine page that matches the URL. This requires generating a URL for that page in order to test it... which requires an a_page route.

If you allow Apostrophe to register the rest of its routes by leaving app_a_routes_register set to true in this application's app.yml, you'll have an a_page route that hides the CMS pages (if any) under /cms, and the a_admin route request will be satisfied that it doesn't match, and your application can go on its merry way.

Do you have app_a_routes_register overridden to false in the app.yml of this application?

I will open a ticket to minimize the impact of Apostrophe on applications that aren't using it by registering all of its routes via Symfony events, not a plugin-level routing.yml file. Then you could set app_a_routes_register to false, choose not to provide an a_page route, and get no errors. For now the workaround is to set it to true, or provide your own a_page route pointing someplace.

Change History

Changed 21 months ago by boutell

  • status changed from new to closed
  • resolution set to fixed

Fixed in [1391]. We now register those routes only when app_a_admin_routes_register is true (the default is true). I know it's one more app.yml setting but we don't actually think people should use it, I just wanted to provide the ability to say no.

The more important feature is this: it will automatically refrain from registering routes for the modules you haven't enabled. So if you're building a backend app and not using Apostrophe you are automatically safe. And that's what this ticket was always about, so I think we're good here.

Note that this means config/routing.yml is strictly verboten in apostrophe plugins. We must register your routes in response to an event (look at our plugin configuration class in apostrophePlugin). You can provide a routing.yml.sample if you're lazy and it's a lab plugin, but it's better to code the registration and check whether the relevant module has even been enabled and so on.

Note: See TracTickets for help on using tickets.