Has anyone tried to use Imagefield Crop or Manual Crop modules with Editable Views? It sure would be nice if Imagefield Crop would work properly and save. Alternatively, it would be great if the Manual Crop selection saved.

Comments

danielphenry’s picture

Same issue with the maxlength module. I suspect the two are related. Probably something preventing js files from loading on the view.

danielphenry’s picture

So the issue with maxlength is that hook_field_attach_form is not being called.

I'm not sure how to generalize this but I found that if I manually call it around line 283 of editableviews_plugin_style_row_edit_table.inc I have all the information necessary for the hook to be successful.

This is not a good solution but it may point someone in the write direction:

        // If this is my field that I'm having problems with.
        if ($field_name == 'field_notice_text') {

          // Find the needed information to call the hook.
          $form_state = array();
          $entity = $this->form[$entity_type][$entity_id][$field_name][LANGUAGE_NONE][0]['#entity'];
          $this->form['#bundle'] = $entity->type;

          // Call hook_field_attach_form here.
          maxlength_field_attach_form($entity_type, $entity, $this->form, $form_state, LANGUAGE_NONE);
        }

I think you could do the same thing with media crop module as a hack to get this working until someone comes up with a more general way to do this.

joachim’s picture

          // Call hook_field_attach_form here.
          maxlength_field_attach_form($entity_type, $entity, $this->form, $form_state, LANGUAGE_NONE);

There is an API function in Field module to invoke a field hook in the module that provides the field type. That's what you need here to generalize.