I got error on D7 with error below

Notice: Undefined index: filefield_paths in filefield_paths_filefield_paths_process_file() (line 45 of C:\Apache24\htdocs\sites\all\modules\filefield_paths\modules\filefield_paths.inc)

How can I fix this issue ?

Comments

rar9’s picture

+1 Same here when adding an D7 simple article

siteogra’s picture

+1. Same problem. I'm use Mulutiupload Image Widget. Standart widget image from core work no stable.

callidryas’s picture

I, too, am experiencing the same issue:

Notice: Undefined index: filefield_paths in filefield_paths_filefield_paths_process_file() (line 45 of /var/www/sites/all/modules/filefield_paths/modules/filefield_paths.inc).

Although, everything appears to work correctly. The images are renamed properly, but the error message is still displayed.

Tim Jones Toronto’s picture

+1 Same here, tested with:

7.x-1.0-beta3 and 2012-Feb-09 dev version.

Used with Drupal 7.12

Thanks.

Bernsch’s picture

Same problem:

Undefined index: filefield_paths in filefield_paths_filefield_paths_process_file() (Zeile 45 von C:\wamp\www\drupal\sites\all\modules\filefield_paths\modules\filefield_paths.inc).

I use:

  • Drupal: 7.12
  • Multiupload Imagefield Widget: 7.x-1.0
  • File (Field) Paths: 7.x-1.0-beta3
David4514’s picture

+same here

simple add of a single file
Drupal 7.12
filefield_paths 7.x-1.0-beta3

David4514’s picture

StatusFileSize
new714 bytes

The problem is that hook_filefield_paths_process_file() may be invoked for file or image fields where filefield settings have not been implemented. When that happens, the Undefined index for $instance['settings']['filefield_paths'] occurs.

A test should first be made to see if this value is set and not empty before executing the rest of the function.

The attached patch returns immediately if $instance['settings']['filefield_paths'] either does not exist or is empty.

alan d.’s picture

The logic is probably right, but this should just be:

+  if (empty($instance['settings']['filefield_paths'])) {
+    return;
+  }

As a followup issue, these defaults should be set with the corresponding _info_alter() hook too.

alan d.’s picture

Status: Active » Needs work
alan d.’s picture

Status: Needs work » Needs review
StatusFileSize
new663 bytes

And the patch (without looking at field instance default values)

tarausa’s picture

I am experiencing the same problem, it looks as though now one knows how to fix it. It seams like to me the default page settings are not configured. I can not figure out how to fix that. The field path will cause problems with many other programs so until this is fixed I can not do anything further.

johnv’s picture

The patch works for me - it removes the notices.

edvanleeuwen’s picture

Tested and verified.

deciphered’s picture

Status: Needs review » Fixed

This issue was fixed and committed a few days ago.

Status: Fixed » Closed (fixed)

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

NenadP’s picture

Got this message on 7.14 when editing content type, and wsod... :(

flashwebcenter’s picture

I had the same problem when I edit a content in 7.14 and filefield_paths 7.x-1.0-beta3. Thank you David4514 and Alan D.

hejazee’s picture

Status: Closed (fixed) » Needs review

This problem still persists in 7.x-1.0-beta3

#10 works fine

Bernsch’s picture

#10 works for me too! Thanx!

deciphered’s picture

Status: Needs review » Closed (fixed)

Please don't re-open fixed issues unless you confirm that they're not working with the latest dev (not beta or stable).

As said, a fix for this issue has already been committed.

Po3t’s picture

Hi, I'm getting this error as well with beta3. There hasn't been a new version released since February 7th, 2012. Any chance we can get a new release soon?

plazik’s picture

Po3t, you can use dev version.
It works for me.

finex’s picture

The bug is still reproducible using 7.x-1.0-beta4 and Drupal 7.22

deciphered’s picture

@FiNeX,

Can't be, not at all possible.

Firstly, there's no code on line #45, so if you're getting the same error as this issue you aren't using beta4.

If you aren't getting this exact error, but similar, you couldn't be either, because if you look at line #47 (http://drupalcode.org/project/filefield_paths.git/blob/refs/heads/7.x-1....) there is a check to see if that value is set before proceeding, therefore preventing said error.

I suspect if you are getting an error, it can't be the same error and is probably unrelated to this issue, in which case can you open a new issue with the details of the specific error you are getting.

If you are absolutely getting the same error, then you aren't using beta4, not possible.