Coming from my comments in #3487566: Warning: Undefined array key "formatter_settings" in Drupal\custom_field\Plugin\Field\FieldFormatter\BaseFormatter->calculateDependencies().

To reproduce:

  • custom field has to be file
  • manage display: use the table formatter
  • set file format to 'file_url_plain' (URL to file)
  • create new node, upload a file
  • node/x which will crash: Undefined array key "formatter_settings" in Drupal\custom_field\Plugin\Field\FieldFormatter\BaseFormatter->getFormattedValues() (line 463 of /home/drupal/modules/custom_field/src/Plugin/Field/FieldFormatter/BaseFormatter.php

The trouble is here: https://git.drupalcode.org/project/custom_field/-/blob/3.1.x/src/Plugin/...

$settings[$name] doesn't contain 'formatter_settings' for file.

Patch upcoming

CommentFileSizeAuthor
#2 3510757-2.patch855 bytesswentel
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

swentel created an issue. See original summary.

swentel’s picture

Status: Active » Needs review
StatusFileSize
new855 bytes

keshav patel made their first commit to this issue’s fork.

keshav patel’s picture

Created an MR from the patch provided on #2, keeping it on needs review.

apmsooner’s picture

Thank you @keshav! Using the issue forks are definitely preferred :)

apmsooner’s picture

Status: Needs review » Fixed
apmsooner’s picture

Status: Fixed » Closed (fixed)