hi
after the fix from yesterday (thanks!) i get this error msg Notice: Undefined index: filefield_sources in filefield_sources_field_process() (Zeile 132 von ./all/modules/filefield_sources/filefield_sources.module).
this comes up when i try to upload a picture and for a secound i see a ajax error msg. i have make a pic

Comments

quicksketch’s picture

There have been some changes to the settings locations. You may need to edit each file field you have created and re-save it's settings (even without changing anything). Would you check if that solves the problem? This problem should not occur with new fields that you set up.

eule’s picture

yup works..but the ajax error appers for a secound

quicksketch’s picture

Try clearing your Drupal caches on the performance settings page. It looks like FileField Sources can't find the callback for displaying the upload progress bar during remote transfers.

steinmb’s picture

Version: 7.x-1.3 » 7.x-1.4

Experienced the same error on a D6->D7 upgraded site. Edit and save all file-field (not only image fields) and the warning goes away.

eliza411’s picture

In case it's useful: with filefield sources 7.x-1.4 working fine, when I enable Video module 7.x-1.x-dev, I consistently get:

Notice: Undefined index: filefield_sources in filefield_sources_field_process() (line 132 of /var/www/drupal/sites/all/modules/filefield_sources/filefield_sources.module).

The error ceases when Video module is disabled. I'm planning to keep it disabled until it has a stable release, but I thought it might be worth mentioning since it erroneously point toward this module.

otx’s picture

I got the same Undefined index error and your suggestion about re-saving everything and clearing caches seems to work.

bryancasler’s picture

subscribe

W.M.’s picture

Idea by quicksketch works fine. Thanks. Moving now to other D6 -> D7 upgrade issues. It looks like I should have waited more time before upgrading. I should have waited more for the development of better codes (especially those related to CCK fields). I just upgraded yesterday.

ts145nera’s picture

StatusFileSize
new635 bytes

Hello,
I've the same question.
I use D7 with Filefiled_sources to manage image and Video module to manage video.
I have two content type, one with images (managed by filefield_sources, IMCE) and one with video (managed by Video module).
When I upload image all work fine, but when I upload video I've the notice:

Notice: Undefined index: filefield_sources in filefield_sources_field_process() (line 132 of /var/www/drupal/sites/all/modules/filefield_sources/filefield_sources.module). 

I try to fix it with this patch. Please review.

ts145nera’s picture

Status: Active » Needs review
dqd’s picture

patch failed

error message:

Hunk #1 FAILED at 123.
1 out of 1 hunk FAILED -- saving rejects to file filefield_sources_module.rej

@ Bitvise Tunnelier Terminal and patch file token via "wget" and "patch"

dqd’s picture

patch applied manually. error message seems to disappear from a brief glimpse so far.

(Can anyone confirm that terminal bash patch doesn't work? Just to know if I did something wrong.)

camsoft2000’s picture

StatusFileSize
new780 bytes

Did not work for me, I've tested the change manually and I can confirm it works. I've generated my own version of the patch.

dqd’s picture

camsoft2000++

Frederic wbase’s picture

Aplied path from camsoft 2000 and works like a charm!

hugojoe’s picture

When Audiofield module enabled, I got the same error as above:
Undefined index: filefield_sources in filefield_sources_field_process() (line 132 of /var/www/drupal/sites/all/modules/filefield_sources/filefield_sources.module).

Then I download camsoft2000's patch to sites/all/modules/filefield_sources, but failed to apply (git apply -v ). Error shows:
error: sites/all/module/filefield_sources/filefield_sources.module: No such file or directory

Best regards

Hugo

hugojoe’s picture

I copy the patch to /var/www/drupal, the error disappears.
But the audiofield does not work: screen shows no "Upload | Remote URL | Reference existing | File attach"

Thanks

Hugo

Frederic wbase’s picture

@hugojoe: maybe problem with audiofield?

philbar’s picture

I'm having this problem as well.

philbar’s picture

The patch in #13 did not fix this issue for me.

Also, I'm not using the Video or Audio modules.

Frederic wbase’s picture

@philbar, strange, wich version are you using?

philbar’s picture

7.x-1.4

bserem’s picture

had the same issue, until I flushed my caches!

philbar’s picture

Flushing my caches does not fix the issue for me.

carteriii’s picture

Guys, I think I see the problem, and I believe the suggested patches earlier in this thread to check the condition a few lines earlier are just hiding the problem.

My source file has the following on line 132:

$enabled_sources = $instance['widget']['settings']['filefield_sources']['filefield_sources'];

Note that the array element 'filefield_sources' is being used *twice*. I believe that line of code is just wrong, would never work, and needs to be

$enabled_sources = $instance['widget']['settings']['filefield_sources'];

As part of my own testing, I printed out the $instance array, and this is what I got

Array
(
    [weight] => -4
    [label] => logo
    [widget_type] => imagefield_widget
    [description] => 
    [default_value] => 
    [widget] => Array
        (
            [type] => image_image
            [weight] => -4
            [module] => image
            [active] => 0
            [settings] => Array
                (
                    [progress_indicator] => bar
                    [use_default_image] => 0
                    [filefield_sources] => Array
                        (
                            [imce] => imce
                            [remote] => 0
                            [reference] => 0
                            [attach] => 0
                        )

                    [filefield_source_autocomplete] => 0
                    [filefield_source_attach_path] => file_attach
                    [filefield_source_attach_absolute] => 0
                    [filefield_source_attach_mode] => copy
                    [preview_image_style] => thumbnail
                )

        )

Note that $instance['widget']['settings']['filefield_sources'] is a valid array with elements of imce, remote, reference, and attach. That seems legit, so I think the proper fix is to remove the duplicate array indexing of ['filefield_sources']['filefield_sources'].

jox’s picture

@carteriii: I can not confirm this. What version of the module are you using? Here - using filefield_sources 7.x-1.4 - it looks like this:

Array
(
    [label] => Images
    [widget] => Array
        (
            [weight] => 7
            [type] => image_image
            [module] => i18n_field
            [active] => 1
            [settings] => Array
                (
                    [progress_indicator] => throbber
                    [preview_image_style] => thumbnail
                    [filefield_sources] => Array
                        (
                            [filefield_sources] => Array
                                (
                                    [imce] => imce
                                    [remote] => 0
                                    [reference] => 0
                                    [attach] => 0
                                )

                            [source_reference] => Array
                                (
                                    [autocomplete] => 0
                                )

                            [source_attach] => Array
                                (
                                    [path] => file_attach
                                    [absolute] => 0
                                    [attach_mode] => copy
                                )

                        )

                    [insert] => 1
                    ...
carteriii’s picture

Wow. That's not what I expected anyone to be able to show. I am also using filefield_sources 7.x-1.4.

So there must be some variation in how $instance is being set. I did upgrade from Drupal & filefield_sources 6.x. Could that be it? Did you start with a clean v7 installation? An upgrade from v6 would seem a reasonable/possible cause.

Since I changed line #132 to remove what I saw as the extraneous ['filefield_sources'] index, everything has been running smoothly for me so I haven't looked back. Your variable contents have me worried my change to the source may come back to bite me.

I'll dig a bit more later (can't do much this weekend). Do you know where the ['filefield_sources']['filefield_sources'] is getting built for you (just to help me pinpoint the difference from what I see)?

jox’s picture

@carteriii: Yes, my installation is a pure Drupal 7. I get the undefined Index error for some other image fields that existed before installation of filefield_sources. The one field I'm using filefield_sources on is working correctly.

Did you try the resave/cache-clear thing on your field? You could also try to create a new field only for testing and print out the $instance array for that, to see if there is any difference.

renegaed’s picture

Thank you camsoft2000 ur patch worked!

philbar’s picture

My problem was from upgrading to D7 which the field settings were corrupted. I reapplied the settings for my image fields and saved them, and the error is no more.

bdimaggio’s picture

Yep the patch in #13 fixed it. Thanks camsoft2000!

sammys’s picture

StatusFileSize
new801 bytes

It appears the check in patch #13 isn't cutting it anymore with 1.4. Here is another patch. I haven't tested this with 7.x-1.x nor have I tested functionality. The error isn't appearing anymore. YMMV functionally.

enekid’s picture

Patch #14 seems to work OK in 1.4, no error appears, thanks!

chrowe’s picture

The fix from #32 seems to have worked for me.
I changed the patch file to use relative links from the module directory and used
patch -p0 < 1138380-32.patch

steinmb’s picture

@sammy pls. reroll #32 with correct paths.
@chrowe p0 patch format is deprecated.
Both pls. read http://drupal.org/node/707484

JaakkoL’s picture

Status: Needs review » Patch (to be ported)
StatusFileSize
new656 bytes

Here's updated version of #32 with correct paths.

vaccinemedia’s picture

#36 works perfectly. Thanks!

steinmb’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Patch (to be ported) » Reviewed & tested by the community

Let's get this one liner committed.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks guys, committed. There should be a new release out this week.

Status: Fixed » Closed (fixed)

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

Bensbury’s picture

Hi,

What happened to this patch?
I don't see a link to the Dev version of filefield sources, and the latest commit info on the module page reads as 2011-Apr-29 and Last modified: May 11, 2012.
Am I missing something?

I'm getting this error and thought to fix it, or has it been added to the current release but the error still exists?
Thanks.