Any list.batch_action starting with an _ (underscore), for instance _delete, processed by sfModelGeneratorConfiguration->compile will lead to that two list actions are created. For instance, if the compile method encounters an batch_action named _delete it will create one batch action named 'batch_delete' and one named 'batchDelete' of which the second one, batchDelete, will also have faulty parameters.
The effect of this bug can be seen in the index view of modules generated with doctrine:generate-admin where one can see that the batch actions list will include two options for deletion: one which displays the label 'Delete' but won't work if you try to use it and a one with a blank label but which has the correct value for the action (i.e batchDelete) and works if you try to use it.
The below patch fixes this bug:
-
a/lib/vendors/symfony/lib/generator/sfModelGeneratorConfiguration.class.php
| old |
new |
|
| 102 | 102 | $this->configuration['list']['batch_actions'] = array(); |
|---|
| 103 | 103 | foreach ($this->getListBatchActions() as $action => $parameters) |
|---|
| 104 | 104 | { |
|---|
| 105 | | $this->configuration['list']['batch_actions'][$action] = $this->fixActionParameters($action, $parameters); |
|---|
| 106 | | |
|---|
| 107 | | $action = 'batch'.ucfirst(0 === strpos($action, '_') ? substr($action, 1) : $action); |
|---|
| 108 | | |
|---|
| 109 | | $this->configuration['list']['batch_actions'][$action] = $parameters; |
|---|
| | 105 | $this->configuration['list']['batch_actions']['batch'.ucfirst(0 === strpos($action, '_') ? substr($action, 1) : $action)] = $this->fixActionParameters($action, $parameters); |
|---|
| 110 | 106 | } |
|---|
| 111 | 107 | |
|---|
| 112 | 108 | // list object actions |