I'm trying to release a usable version of Views Form Fields module using the new form capabilities of views 3 introduced a few months ago.

After playing a bit with the handlers I'd noticed that there is really hard to define a useful name for a form field due views uses the internal name of the field defined in $views->field.

Also, each item of a row is only named with the id of the row. This behavior reduces a lot the possibilities to use an id from other field of the view, like a uid or a nid. It would be nice to see, after submit the form something like:

dsm($form_state['values']);

array(
  'my_field' => array(
    'nid:23-row:0' => 'Something',
    'nid:25-row:1' => 'Something else',
    //...
  )
)

So, it would be nice to give more control to handlers to edit the values that identifies the form fields and each items.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dagmar’s picture

Status: Active » Needs review
FileSize
3.43 KB

Here is the patch. I tried to make it compatible with the previous version of the form api. But I have updated the docs to indicate how to make use of the new methods.

dawehner’s picture

+++ b/help/api-forms.htmlundefined
@@ -11,19 +11,31 @@ The views handler can also implement views_form_validate() and views_form_submit
+      $form_element_row_id = $form_element_row_id($row_id);

This must be magic, as you call a function by it's string. You probably wanted to use $this->form_element_row_id($row_id); here instead

The patch looks clean and shouldn't break something. Though i would like to get an oppinion of bojanz as he uses it and it shouldn't break his module.

It's cool to know that you continue to work on views form fields.

dagmar’s picture

FileSize
3.44 KB

Fixed the this->form_element_row_id($row_id); call in the docs.

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Just tested vbo, nothing changed.

Thanks for the patch.

let's get the patch into 6.x-3.x as well.

bojanz’s picture

This is / was a benign patch. Nice job.

dagmar’s picture

Status: Patch (to be ported) » Needs review
FileSize
3.44 KB

Here is the 6.x-3.x version.

MustangGB’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)