Errors: Invalid argument supplied for foreach
Dickster - June 28, 2007 - 15:47
| Project: | Image watermark |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | schnizZzla |
| Status: | closed |
Description
Hi there,
I've installed the watermark module using drupal 5.1 but get this error:
warning: Invalid argument supplied for foreach() in /home/sites/example.com/public_html/site/modules/watermark/watermark.module on line 503
I also get a message, image not found even though the url given is correct?
I'm using this module in conjunction with Image, Image attach, Image gallery and Image Import, all 5.x-1.2 modules. Many thanks for your help.

#1
thank you for the report, I'd rather think a 503 error is some server misconfiguration, maybe a problem with clean urls, but that is just a guess. I need to go out now, but I'm going to check later, if this is a bug or a problem with your own (server) configuration.
when does this error occur? when you enable the module? or when you go to admin/settings/image_watermark ??
#2
Changing title.
#3
The error occurs when I upload an image. I'll try and resolve the clean url situation to see if that helps. Thanks.
#4
Same issue here....
I get:
* warning: Invalid argument supplied for foreach() in C:\Program Files\Apache2\htdocs\modules\watermark\watermark.module on line 503.
* warning: Invalid argument supplied for foreach() in C:\Program Files\Apache2\htdocs\modules\watermark\watermark.module on line 503.
* warning: Invalid argument supplied for foreach() in C:\Program Files\Apache2\htdocs\modules\watermark\watermark.module on line 503.
3 times that is.
As far as I can see my clean url's work just fine. I've got image cache up and running, and I haven't had any problems with that one. It happens when I try tu submit or preview an image. Screenie included....
#5
This seems to be related to taxonomy in one way or another.
Are there any terms in the gallery vocabulary?
#6
ok, so this check is still buggy.
I'm trying to replicate this later and fix it.
@Dickster
@nikkelei
Please just tell me, if you have image gallery enabled (I suppose you have) and if you have had any image galleries already created?
#7
making a bug of it, because there still is a check missing.
Last patch I've had added the check for no gallery taxonomy created.
#8
I have galleries created before trying to upload further images to them.
#9
Okay, now I've tried it myself:
Image: 5.x-1.2 (all contributed modules also enabled)
My steps:
- clean drupal installation
- make files directory
- run 1st cron
- enable clean urls
- Enable all image modules
- Go to image settings for automatic image directories creation
- Save image settings
- Upload image -> no error, OK since image watermark is not enabled yet
- Copy watermark to files directory now
- Got to image watermark settings
- Enable watermarking of new images
- Watermark path: files/watermark.jpg
- Location: Middle
- Apply watermark to the following images: thumbnail, preview, _original
- Save watermark settings
- Upload new image (Image galleries: none) -> error happens here!
- Goto admin/content/image, add gallery Berlin, save
- Upload new image (Image galleries: none) -> error happens here, too!
- Upload new image (Image galleries: Berlin) -> error happens here, too!
BUT watermark has been applied each time!
I'm going to make a patch for this.
@Dickster
@nikkelei
Please tell me when watermark has not been applied in your case.
#10
title changed
I did't see any file not found error.
#11
Here is a patch.
The Problem was the different representation of taxonomy. *slap*
I understand: If multiple selection of gallery terms is allowed (it was on my testserver) taxonomy is an nested array.
#12
sorry, forgotten trying out the patch
#13
Committed to 5.x and HEAD.
Please wait for 12 hours, then download the tarball and test it again.
#14
no, it's ok, worked fine.
#15
oops, sorry
#16
tarball is up to date
#17
Thanks, the 503 error has been fixed but I still get the image not found error even the though the url is correct? I've taken the url that supposedly can't be found and put it in to my browser to double check and it works fine. I've tried png and gif but with the same results. Any ideas?
#18
I can't help you without more information.
Please open a new issue for that. Provide at least these information:
0. Go to admin/logs/status, is everything ok there? Are file permissions configured properly? Is PHP save mode on?
1. Write down the error message, I did not see any file not found error message cited above
2. Go to admin/settings/file-system
- What is your File system path? What is your temporary path?
3. Go to admin/settings/image
- What is the Default image path?
4. Go to
- What is the path for Watermark overlay image?
Thanks.
#19
Issue in title is fixed. Other issue needs more info and should be cared for in an seperate issue.
These are two different problems.
#20