Development

#5851 (Doctrine Admin Generator : wrong generated url for custom list actions)

You must first sign up to be able to contribute.

Ticket #5851 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Doctrine Admin Generator : wrong generated url for custom list actions

Reported by: nervo Assigned to: Kris.Wallsmith
Priority: minor Milestone:
Component: other Version: 1.2.4
Keywords: Cc:
Qualification: Unreviewed

Description

In generator.yml, if i declare a custom list action :

      list:
        actions:
          _new: ~
          export: {label 'Export', action: 'export'}

Though that the generated php template is good :

<?php echo link_to(__('Export'), 'myModel/export', array(), 'messages') ?>  </li>

The generated html link has a weird '/action' string added to its end :

<a href="/backend_dev.php/myModel/export/action">Export</a>

I tried to debug to see what happend, but i quickly felt lost in routing process....

Change History

03/28/09 17:49:56 changed by FabianLange

  • milestone changed from 1.2.5 to 1.2.6.

04/07/09 00:29:35 changed by Kris.Wallsmith

(In [17063]) [1.2, 1.3] fixed generated links (refs #5851)

04/16/09 14:19:10 changed by FabianLange

  • owner changed from fabien to Kris.Wallsmith.

Kris, did your change close this issue?

04/17/09 19:15:28 changed by Kris.Wallsmith

(In [17401]) [1.2, 1.3] added sfObjectRouteCollection tests (refs #5851)

04/17/09 19:25:29 changed by Kris.Wallsmith

(In [17402]) [1.2, 1.3] added more tests to sfObjectRouteCollection (refs #5851)

04/17/09 19:29:10 changed by Kris.Wallsmith

  • status changed from new to closed.
  • resolution set to invalid.
  • milestone deleted.

The URL you see is generated by the *_collection route, which is generated by sfObjectRouteCollection when the with_wildcard_routes option is enabled. As a side note, this route includes a sf_method requirement of POST.

If you want a different URL to be generated you can use the collection_actions option in routing.yml:

article:
  class: sfDoctrineRouteCollection
  options:
    model: Article
    module: article
    prefix_path: article
    column: id
    with_wildcard_routes: true
    collection_actions:
      export: [get]