Hello,
I've looked up into the issue queue of editablefields and there were no results for that so i opened this issue here and i'll explain why.

editablefields is not integrated well with the module title. When i convert the property into field and add the field in a view and apply the formatter the field title was not changed. Yes, the textfield looked like it's reloaded the data from the DB but when refreshing the page, the title stay the same.

I think this caused by the title module because editablefields edit successfully other fields - dates, text, integer and more.
I think i can manage this problem but i open this so other people can help.

Best regards,
roy.

Comments

roysegall’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Patch is attached.

Roy :)

roysegall’s picture

StatusFileSize
new1.14 KB

After some work i found another problem - when other fields are being saved to title get an empty value because we not edited the field with the value.

I attached the second patch.

oana.hulpoi’s picture

oana.hulpoi’s picture

Hi Roy,
When using title field in a view with multiple rows, only the title from the first row is updated as expected. It won't work on the next rows (views row > 0).

if (empty($form[$legacy_field]['#field_replacement'])) {
        if (!empty($form_state['values'][$field_name][0][$field_name][$langcode][0]['value'])) {
          $entity->{$legacy_field} = $form_state['values'][$field_name][0][$field_name][$langcode][0]['value'];
        }

Regards,
Oana

roysegall’s picture

What is the use case for multiple title fields?

oana.hulpoi’s picture

It is not a multiple title field. It is a view page with multiple results (rows). Each row contains a title field and other custom fields. The title field is saved correctly only for the first row. As I see in your code, the verification is done only for the first row: $form_state['values'][$field_name][0]

Regards,
Oana

miccelito’s picture

@Oana

Yes, same here. Patch above seems to works for a views first row, others not

miccelito’s picture

Looking for integration with editablefields then you better instead try module Automatic Nodetitle http://drupal.org/project/auto_nodetitle
The 7.x-1.x-dev version seems to work fine.

roysegall’s picture

@miccelito i think the auto node title is answering what i need and i'll explain: I have some products that i bought to the office and i want to display them with views. I used the editable fields module so i could edit the fields and used title module so the title will be editable as well. I'll try work on the patch later this day.

miccelito’s picture

I've also posted a comment "Editable title field (Automatic Nodetitle vs Title)" https://drupal.org/node/1915094 - enabling Automatic Nodetitle module will solve the editable title field issue for Editablefields module. I've tested it and works fine with Editablefields.
@RoySegall - What kind of patch do you have in mind?

roysegall’s picture

@miccelito the patch is half done - just need to apply the comments on the patch.

roysegall’s picture

OK! i worked on the patch. Funny, i tested it with multiple rows in the view, never mind that.

Patch is attached.

roysegall’s picture

I'm attaching another patch. The patch fix an exception that thrown when creating a node, even if the content type don't have a title field replacement.

Status: Needs review » Needs work

The last submitted patch, editablefields_integration_1841834_13.patch, failed testing.

roysegall’s picture

I think this patch failing because the patch was is not rolled well. I re rolled the path, hope it will fix it.

roysegall’s picture

Status: Needs work » Needs review
romaingar’s picture

@RoySegall
Hi, i'm looking your patch and it seems that if the title_field is not a multivalues field it doesn't work for editablefields.
I purpose a simple change to your patch to allow simple value field :

+      $field_name = $info['field']['field_name'];
+      // When the original property input is not in the form we need to apply
+      // the new replacement field value manually.
+      if (empty($form[$legacy_field]['#field_replacement'])) {
+        if (isset($form_state['values'][$field_name])) {
          if(isset($form_state['values'][$field_name][$langcode][0]['value'])){
              $entity->{$legacy_field} =$form_state['values'][$field_name][$langcode][0]['value'];
          }else{
+          foreach ($form_state['values'][$field_name] as $key => $value) {
+            if (!empty($form_state['values'][$field_name][$key][$field_name][$langcode][0]['value'])) {
+              $entity->{$legacy_field} = $form_state['values'][$field_name][$key][$field_name][$langcode][0]['value'];
+            }
+          }
           }  
+        }
+      }
+      else {

Sorry, I'm not very comfortable with patching...

transformative’s picture

The patch in #17 worked for my needs.

It allowed me to successfully edit the title as an editable field in a node (used in a panel).
However, it didn't work for me for editing an editable field in a single-row view (in a panel). I assume I was doing something different from what the others had described earlier.
Nevertheless, it was quite useful for what I needed.

I have created a diff patch out of what was in #17 (with a couple of extra lines from the top of #15 that had been left out, and a couple of minor formatting changes).

glynster’s picture

@transformative this patch worked a treat for me in the content node view. +1 RTBC

pifagor’s picture

Status: Needs review » Fixed

outdated patch

pifagor’s picture

Status: Fixed » Closed (fixed)