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.

Aurochs’s picture

I have the same issue. Few days ago i moved to new VDS, installed ubuntu 14 and made fresh install of the server etc. I decided to start using graphicsmagic, installed from repositories and after that tried to create a node with pictures - i got the Deprecated function: preg_replace() , resolved the mistake with the fresh dev release but came to a new mistake - the one in this issue thread.
But i have a bit different notice:

.... filefield_paths_entity_update() (строка 259 в файле /var/www/gamepart.ru/sites/all/modules/filefield_paths/filefield_paths.module).

Aurochs’s picture

@Deciphered - i have a differnt line in dev release - #259 and patch from #4 fixed my issue now works fine.
Thank you, Uv516 !

Deciphered’s picture


This issue is marked as closed. If you believe it is still an issue, re-open the issue, otherwise there's a chance it will never be seen (I just happened to be looking closely).

It appears to have been closed due to lack of ability to reproduce, so if you can provide steps on how to reproduce this issue from a fresh install of Drupal that would be extremely helpful.

Leaving this closed, until you actively re-open the issue.

Aurochs’s picture

Issue tags:+code

I would like to re-open the issue because i had to aply the above mentioned fix again after another dev update. here is a screen on what image modules i use incl tokens http://prntscr.com/84ukob, my field settings where i see error (other fields same error0 http://prntscr.com/84um70

Deciphered’s picture

Don't say it, do it. Change the status of this issue to 'Active', and as I asked in the previous comment, provide me with steps to reproduce the issue. Not some screenshots, but steps (1. Install Drupal, 2. Download modules (provide list), etc).

If I can't reproduce an issue I can't fix it, and regardless of there being a 'patch' available, I don't blindly commit untested code.

While this may be too much to ask, it's the different between me spending a few minutes to get a working solution for all, or me spending hours try to reproduce an issue I've not seen before which for various reasons may not be possible, and potentially giving up on the issue.

Deciphered’s picture

Aurochs’s picture

@Deciphered really sorry dont hv much time as i am moving around 10 sites now to a new server+close to divorce with my wife. Let it be a duplicate thanks for your efforts