Development

#4947 (Admin Generator : Can't add a new action to submit form data)

You must first sign up to be able to contribute.

Ticket #4947 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

Admin Generator : Can't add a new action to submit form data

Reported by: rosbif_fr Assigned to: fabien
Priority: minor Milestone: 1.2.0 RC1
Component: generator Version: 1.1.2
Keywords: admin sfadmingenerator Cc:
Qualification: Unreviewed

Description

Adding an action in the following way :

      actions:
        _list: ~
        _save: ~
        save_and_edit_next: ~

currently creates a html button which performs a GET, not a POST, so a user-added action cannot save the form data.

I suggest the following patch to generator/sfAdminGenerator.class.php

95c95
<      if ($actionName == 'save' || $actionName == 'save_and_add' || $actionName == 'save_and_list')
---
>      if (strpos($actionName, 'save') === 0)

Which will allow users to add a post action for any action name that starts with _save in the following way :

      actions:
        _list: ~
        _save: ~
        _save_and_edit_next: ~

Change History

11/16/08 23:58:32 changed by fabien

  • milestone changed from 1.1.5 to 1.2.0 RC1.

It won't be fixed in 1.1 as this version in is maintenance mode and this is a new feature. But it will be fixed in 1.2.

11/17/08 00:02:34 changed by fabien

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

(In [13048]) [1.2] added a way to customize the actions added on a form (closes #4947)

11/17/08 00:05:36 changed by fabien

(In [13049]) [1.2] added a way to customize the actions added on a form (closes #4947)

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.