This topic contains 5 replies, has 2 voices, and was last updated by Grégory PLANCHAT 8 years, 7 months ago.
- Topic
Hi,
I’m currently writing an inventory bundle for OroPlatform (using OroCommerce here) and I’m facing for the 2nd time a js error with router.js.
The error I get from the javascript console is :
Uncaught Error: The route “luni_inventory_bundle_warehouse_zone_update” does not exist
To fix this, I used the “expose”=true option in my controller action’s annotations :
12345678910111213141516171819202122232425/*** @param Request $request* @param WarehouseZone $warehouseZone* @return array|RedirectResponse** @Route(* "/update/{id}",* name="luni_inventory_bundle_warehouse_zone_update",* requirements={"id"="\d+"},* options={"expose"=true}* )* @Template* @Acl(* id="luni_inventory_bundle_warehouse_zone_update",* type="entity",* permission="EDIT",* class="LuniInventoryBundle:WarehouseZone"* )*/public function updateAction(Request $request, WarehouseZone $warehouseZone){return $this->update($request, $warehouseZone);}This seemed to solve the initial problem, until I faced an authentication error and launched the router:debug command
My route’s URL was modified by the “options” annotation’s parameter, it didn’t match my URL expectations (notice the /admin prefix missing) and as a result wasn’t using the correct authentication adapters :
123456orocommerce-application gplanchat$ app/console router:debug | grep luni_inventory | grep zoneluni_inventory_bundle_warehouse_zone_create ANY ANY ANY /admin/inventory/warehouse/zone/create/{id}luni_inventory_bundle_warehouse_zone_update ANY ANY ANY /inventory/warehouse/zone/update/{id}luni_inventory_bundle_warehouse_zone_view ANY ANY ANY /admin/inventory/warehouse/zone/{id}Is there some way to fix this issue?
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.