With a default weight of 0, the title form element often gets after a custom field with the same default weight. Patch attached.

CommentFileSizeAuthor
eck.title_weight.patch450 bytesLes Lim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kolier’s picture

I think solve this problem should combine with 'hook_field_extra_fields()'.

function eck_extras_field_extra_fields() {
  $fields = array();
  foreach (EntityType::loadAll() as $entityType) {
    foreach (Bundle::loadByEntityType($entityType) as $bundle) {
      $fields[$entityType->name][$bundle->name]['form']['title'] = array(
        'label' => t('Title'),
        'description' => t('Set the title of this entity.'),
        'weight' => -10,
      );
    }
  }
  
  return $fields;
}
cdracars’s picture

I have applied the patch and found it to function... I'm not sure how to make the second approach work however?

kolier’s picture

Hi, cdracars,

Try ECK Extras: http://drupal.org/sandbox/kolier/1700728, and give some feedback.

Jorrit’s picture

I don't agree with the patch, because users should be able to drag the title field below another field, just like with nodes. The patch from #2 and also #1824772: Add entity properties to "Manage Fields" form add that functionality.

webadpro’s picture

I feel like the title should be added as a manageable field. Since nodes are more fixed as term of what they do, ECK allows endless possibilities. I think adding the title field is simply adding extra flexibility.

ff1’s picture

Status: Needs review » Needs work

The patch at #1824772: Add entity properties to "Manage Fields" form allows you to arrange the order of fields and properties as required, which is a much more flexible solution. Let's get that patch committed, then this patch is not required.

webadpro’s picture

Right. I Must agree with you ff1.

eric.napier’s picture

Issue summary: View changes
Status: Needs work » Fixed

marking fixed, since #1824772: Add entity properties to "Manage Fields" form is complete this issue is no longer relevant.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.