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

schnizZzla - June 28, 2007 - 18:52
Assigned to:Anonymous» schnizZzla

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

kbahey - June 28, 2007 - 20:01
Title:503 error» Errors: Invalid argument supplied for foreach, and image not found

Changing title.

#3

Dickster - June 29, 2007 - 12:40

The error occurs when I upload an image. I'll try and resolve the clean url situation to see if that helps. Thanks.

#4

nikkelei - July 3, 2007 - 02:31

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....

AttachmentSize
Untitled-2_2.jpg 76.68 KB

#5

kbahey - July 3, 2007 - 02:37

This seems to be related to taxonomy in one way or another.

Are there any terms in the gallery vocabulary?

#6

schnizZzla - July 3, 2007 - 08:55

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

schnizZzla - July 3, 2007 - 09:00
Category:support request» bug report
Status:active» postponed (maintainer needs more info)

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

Dickster - July 3, 2007 - 10:46

I have galleries created before trying to upload further images to them.

#9

schnizZzla - July 3, 2007 - 16:28

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

schnizZzla - July 3, 2007 - 16:41
Title:Errors: Invalid argument supplied for foreach, and image not found» Errors: Invalid argument supplied for foreach

title changed
I did't see any file not found error.

#11

schnizZzla - July 3, 2007 - 17:44
Status:postponed (maintainer needs more info)» reviewed & tested by the community

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.

AttachmentSize
watermark.taxonomy_toggle.patch 985 bytes

#12

schnizZzla - July 3, 2007 - 17:57
Status:reviewed & tested by the community» needs review

sorry, forgotten trying out the patch

#13

kbahey - July 3, 2007 - 18:00
Status:needs review» fixed

Committed to 5.x and HEAD.

Please wait for 12 hours, then download the tarball and test it again.

#14

schnizZzla - July 3, 2007 - 18:02
Status:fixed» reviewed & tested by the community

no, it's ok, worked fine.

#15

schnizZzla - July 3, 2007 - 18:03
Status:reviewed & tested by the community» fixed

oops, sorry

#16

schnizZzla - July 4, 2007 - 12:39

tarball is up to date

#17

Dickster - July 4, 2007 - 13:56
Status:fixed» active

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

schnizZzla - July 4, 2007 - 14:20

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

schnizZzla - July 4, 2007 - 14:22
Status:active» fixed

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

Anonymous - July 18, 2007 - 14:47
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.