field_info_max_weight() deals with display extra fields incorrectly

Created on 31 May 2011, over 13 years ago
Updated 1 September 2024, 7 days ago
  // Collect weights for extra fields.
  foreach (field_info_extra_fields($entity_type, $bundle, $context) as $extra) {
    $weights[] = $extra['weight'];
  }

When $context is 'display', the result of field_info_extra_fields() is an array of display modes.

This causes a "Notice: Undefined index: weight" error when creating a field instance without weight to an entity that has a display extra field.

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component
Field 

Last updated 1 day ago

Created by

🇫🇷France Damien Tournoud

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone New Zealand

    9 years ago it was asked if this is still an issue in Drupal 8+. There has been no reply confirming that which suggests that this is outdated. However, let's do one last check.

    Is this still relevant?

    Since we need more information to move forward with this issue, I am setting the status to Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • Status changed to Closed: outdated 7 days ago
  • 🇳🇿New Zealand quietone New Zealand

    There hasn't been confirmation that this problem still exits since asking 5 moths ago. Therefor closing.

    If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").

    Thanks!

Production build 0.71.5 2024