Problem/Motivation

Not sure if this is something that Filefield Paths can or should address, but when it is configured for a field the expected result for the file item from that field gives incorrect values.

Steps to reproduce

use Drupal\Core\Field\TypedData\FieldItemDataDefinition;
use Drupal\file\Plugin\Field\FieldType\FileItem;

    // Create a file item to get the upload location.
    $media_type = \Drupal\media\Entity\MediaType::load($media->bundle());
    $field_definition = $media_type->getSource()->getSourceFieldDefinition($media_type);
    $data_definition = FieldItemDataDefinition::create($field_definition);
    $item = new FileItem($data_definition);
    $upload_location = $item->getUploadLocation();

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mlncn created an issue. See original summary.

voleger’s picture

Status: Active » Postponed (maintainer needs more info)

No, you can check filefield_paths_form_field_config_edit_form_alter(): the config values used by getUploadLocation are not being touched, so they remain set as is, as FFP handles its own configs in the third-party settings.