Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexverb created an issue. See original summary.

alexverb’s picture

Status: Active » Needs review
Deciphered’s picture

Patch looks good, and is exactly what my intent was, just badly executed as it was some of my first D8 work. Will do a manual test (as automated tests are still not currently passing).

Deciphered’s picture

Status: Needs review » Needs work

Automated tests fail (on an environment where they normally pass):

Missing argument 1 for Drupal\Core\TypedData\TypedData::__construct(), called in /var/beetbox/docroot/modules/filefield_paths/filefield_paths.module on line 45 and defined
Undefined variable: definition

Issue is related to the new $class section, as it evidently expects arguments.

Deciphered’s picture

Deciphered’s picture

Simple fix: if (class_exists($class) && new $class($field->getItemDefinition()) instanceof FileFieldItemList) {

  • Deciphered committed d848578 on 8.x-1.x
    #2679329 by alexverb, Deciphered: Added improved support for field types...
Deciphered’s picture

Status: Needs work » Fixed
alexverb’s picture

Just want to let you know you'd probably want to remove hook_filefield_paths_field_type_info() reference in filefield_paths.api.php.

Deciphered’s picture

Yup, there's absolutely cleanup stuff that needs to be done still. Will open that as a new issue.

Status: Fixed » Closed (fixed)

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

geek-merlin’s picture

Just a note: This works for all types that extend FileFieldItemList, but not if they decorate it.
Fixing this is only possible if core adds a FileFieldItemListInterface.