Get a warning when the image_attach is used in a view that has no results

mxconsulting - October 1, 2009 - 06:45
Project:Image
Version:6.x-1.0-beta3
Component:image_attach
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

* warning: implode() [function.implode]: Invalid arguments passed in C:\xampp\htdocs\TTT\sites\all\modules\image\contrib\image_attach\image_attach_views_handler_field_attached_images.inc on line 73.

* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY weight' at line 1 query: SELECT nid, iid FROM image_attach WHERE nid IN () ORDER BY weight in C:\xampp\htdocs\TTT\sites\all\modules\image\contrib\image_attach\image_attach_views_handler_field_attached_images.inc on line 74.

When my view has no results I get this warning.
It should be fixed very easy the implode should not be called if there are no nids.

AttachmentSize
image_attache_warning.JPG89.46 KB

#1

joachim - October 1, 2009 - 10:42
Status:active» needs review

Thanks for reporting this bug.

Please could you test this patch?

AttachmentSize
592852.image_attach.views_empty_bad_sql.patch 2.25 KB

#2

Sara Adams - October 3, 2009 - 06:47

I tested the patch, and it resolved the problem for me. Thanks!

[Drupal 6.14, Image 6.x-1.0-beta3]

-- Sara

#3

joachim - October 3, 2009 - 07:39
Status:needs review» fixed

Patch committed to CVS; this will be available in the dev version shortly.

Thank you for testing :)

#4

Joyce8989 - October 6, 2009 - 02:39

thank you very much.

#5

manderson311 - October 10, 2009 - 02:39

I tried applying the patch using ... patch < file.patch but I'm getting the error "Only garbage was found in the patch input." I'm using the dev version. This is the firrst patch I'm applying, I'm sure I'm doing something wrong... Any ideas?

#6

joachim - October 10, 2009 - 07:56

I've committed the patch, so there is no need for you to apply it.
When I say 'shortly', I mean when the CVS bot gets round to it, which is a matter of hours -- so it's in the dev version by now.
You can always check CHANGELOG file inside a download. That has a list of all changes, with the relevant issue number (in this case, for example, 592852).

#7

System Message - October 24, 2009 - 08:00
Status:fixed» closed

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

#8

webtiq - November 3, 2009 - 01:21

Hi,
The patch is effective. Thanks.

#9

joachim - November 3, 2009 - 01:06

I'm afraid I really don't follow the last comment.
Please try with the latest dev release.

#10

webtiq - November 3, 2009 - 01:50

Thanks. Everything is OK now. The correction about this bug is working well

 
 

Drupal is a registered trademark of Dries Buytaert.