I am using File (Field) Paths.


Drupal 7.18
Token 7.x-1.x-dev
File (Field) Paths 7.x-1.x-dev

Error message

Warning: Invalid argument supplied for foreach() filefield_paths_entity_update() függvényben (D:\htdocs\__drupal7\sites\all\modules\filefield_paths\filefield_paths.module 232 sor).

What's wrong?


Deciphered’s picture

Status:Active» Postponed (maintainer needs more info)

Please provide some more information, preferably step-by-step instructions to reproduce this issue.

However, based on the code, this error should be impossible, because the line before the erring line is a conditional statement to ensure that there is a valid argument for the foreach() statement, and as the data is provided by the Fields system, the only reason it could be malformed is if something else was getting involved.

Happy to help further if you can provide more information.


dpfitzsi’s picture

Issue summary:View changes

I get this same error if I have active updating enabled for my filefield, and I update the content of a node, I receive this error.

I've tried beta4 and the latest dev and I receive this error with both.

neRok’s picture

Version:7.x-1.x-dev» 7.x-1.0-beta4
Assigned:vikicica22» Unassigned
Status:Postponed (maintainer needs more info)» Closed (cannot reproduce)

I have just tested for this error with what little information is given, and cannot reproduce.

The original error refers to line 232, which is an empty line in the current dev version. Hence, going to close under the presumption that the error no longer occurs in current version.

Late edit: This may be related to a fix in the current dev #1985280: Warning: Invalid argument supplied for foreach() in filefield_paths_entity_update()

Uv516’s picture

I have tested width a field wich upload mp3-file.
I got the error in two ways: 1) When I create a new node - and - 2) When I add a file to a empty field in an exsting node.
When I press "Save" the error occur.
I can edit the same node (the file-filed is filled) and save again without error.

Then I empty the file-feld - save and edit - fill the field-field - save: Error again.
In line 247 the variable $enabled is TRUE and $entity->{$field['field_name']} is set, but is empty! (Not an array!)

A patch could be:

- if ($enabled && isset($entity->{$field['field_name']})) {
+ if ($enabled && isset($entity->{$field['field_name']}) && is_array($entity->{$field['field_name']})) {

This works for me now without error.