Per this thread, someone mentioned they narrowed this warning/error down to swfupload. I checked an install I was having an issue with, and can confirm after deleting any images attached to the node, the warning goes away.
Doesn't matter if I re-order the images or not, as long as there are images attached to a node through swfupload, I receive this warning.
The warning does not appear if I only have one image, but it appears twice if I have 3 images, 5 times if I have 6 images, etc etc. This is why originally I couldn't pin which module was causing me the problem, because I had a lot of nodes with just one image that didn't display the error.
Comments
Comment #1
sansui commentedForgot to link thread where issue is discussed - http://drupal.org/node/829250
Comment #2
EugenMayer commentedrunning into this issue also having swfupload installed, so this shall be confirmed. Pretty anoying message, setting it to major
Comment #3
yakker commentedHaving this issue also, but I do not have swfupload on the site....
Comment #4
sansui commentedLooking at other modules that have had this issue, it seems most that have resolved it have indicated it's an issue with a default value somewhere, or a value being set twice by two different modules.
I tried poking around but not really sure what I was looking for. In the meantime I guess it's back to fupload for these sites.
Comment #5
sansui commentedAlright, one last thing to offer - it seems like the error is only occurring on ubercart product pages. I set up a page content type with just the swfupload imagefield and some other fields, and those pieces of content display the images without error.
So is this a conflict with ubercart? Eugen, are you having the issue with UC pages?
Comment #6
EugenMayer commentedWell finally i see that my issues tracks down to apachesolr right now, and no, no UC involved
Comment #7
sansui commentedAlright, paint me embarassed. Somehow in my product tpls, I had commented out where I was setting variables for product titles, alts, descriptions, and the error was occuring from the imagecache function I was calling and using those variables.
Edit: Actually... I still have no clue what's going on. After fxing that, the error went away, now it's back. Seemingly intermittent. Banging head on desk
Edit 2: Some of my nodes are not displaying the error, but I can get all of them to display it if I do this:
1.) Find node without error
2.) Edit node, save without changing anything, error now appears
To remove the error:
1.) Edit node, enter a title for an image
2.) Save node, error is gone
Each time I edit the node, as long as I add or remove a title field, the error doesn't appear. Once I save without deleting/adding title text to an image, I get the error again. When the error is not present, I can refresh the node as many times as I want and not get the error. Once I save without modifying a title field, the error is present and stays however long I refresh the node, until I add a title tag again.
This happens in Garland theme as well, and not just my own, and I can reproduce these steps in Garland to get the error to appear or disappear
Comment #8
sansui commentedOk... more digging. I made some changes to swfupload_widget.inc which starts on line 62. I changed line 76 from:
$file += array('description' => $tmp_file['data']['description'], 'alt' => $tmp_file['data']['alt'], 'title' => $tmp_file['data']['title']);To the following:
The error no longer ever appears with this in place. Am I right to assume then the problem is when these tmp_file variables are empty?
Comment #9
matulis commentedThanks, sansui! No error message anymore :)
swfupload_widget.inc, line 82 (6.x-2.0-beta7)
replace
with
Comment #10
kirilius commentedI have very similar issues with SWFUpload. If the above fix works, can it be rolled into a release?
Comment #11
EugenMayer commentedThe above works, but be aware it wont fix existing uploaded files only for following uploads.
I will stuff this into the next release.
Comment #12
kirilius commentedHmm... I actually tried the fix and it really didn't fix my old nodes.
Comment #13
sansui commentedYou might try resaving your old nodes kirilius..... this won't fix things retroactively.
Comment #14
kirilius commentedYes, resaving the old nodes cleaned up the mess ;-)
Thanks!
Comment #15
EugenMayer commentedSo for the records:
if you apply the patch, you have to resave the old nodes so the error disapears there. New nodes wont be buggy anymore.
(will need that for the release notes)
Comment #16
skilip commentedThanks guys!
Comment #18
kirilius commentedI got the beta8 and the problem is still there. Does anybody know when the fix will be available in a release?
Comment #19
sylverspyder commentedHi,
I'm second-ing kirilius. Im on 6.x-2.0-beta8 as well and saw this bug when I edit and rearrange uploaded images.
Furthermore, the new arrangement wont get saved, no matter how many times i tried to edit it.
Hope you guys can fix this soon :D
Thanks.
Comment #20
ranx commentedI had the same problem with 6.x-2.0-beta8
Applied the fix from #9 and everything seems to work.
EDIT:
The original error message disappeared but the fix seems to have messed up something else. No matter what I do I can't get views to display any images. Even ones that have been uploaded through imagefield. I also got several errors inside views. I might have done something wrong myself but i would proceed with caution when trying this fix.
Comment #21
Naiya commentedi fix my 6.x-2.0-beta8 with a patch from #9.
I was carefully as @ranx said. i have added a view with my swfupload-field and modify existing one.
for now everything seems to be fine.
Comment #22
net_runner commentedSame here on beta8 - but bug shows on line 857 (6.20).
Comment #23
jvandooren commentedI also patched my 6.x-2.0-beta8 with the patch from #9.
I re-saved the specific node, error was gone. I created a view and the photos were displayed just fine...
Comment #24
kirilius commentedI believe it is confirmed that the fix from #9 does remove the problem. Can it be rolled into a release so it doesn't need to be applied manually every time one re-installs (updates) the module?
Comment #25
jvandooren commentedPatch with the changes from #9 attached...
As Kirilius mentioned, I also think it's safe to change the status...
Comment #26
jvandooren commentedAnd I forget to do it :)
Comment #27
roderikRTBC +1!
New patch is the same, only has a little more consistent spacing.
Comment #28
carvalhar commentedok #9 worked for me.
Comment #29
anybodyHi,
when will the patch be applied to a released version?
Comment #30
bzbzh commentedsubscribe
Comment #31
doublejosh commentedCripes, patch didn't solve it for me.
I have one htmlspecialchars() error for each filefield image on the node page and really thought this was going to get it.
However, when I disable this module the errors go away.Will keep digging.Comment #32
doublejosh commented...and nevermind... this DOES WORK! Just needed to RESAVE nodes... like it says in plain English above.
(I'm running on the latest beta8)
Comment #33
huba commentedsubscribe
Comment #34
doublejosh commentedI was also able to solve this problem on node types by adjusting the field display settings.
Comment #35
pfournier commentedI have the same problem. The proposed patch fixed the error message, but not the root of the problem, which is that the alt and title attributes of the $tmp_file['data'] are set to an empty array instead of an empty string.
We should try to find who is responsible for this bad data (maybe the javascript code?).
Comment #36
faqing commentedI have installed this module in two sites (sub-domain) of the same server. One has no problem, one with this message:
warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/xxx/includes/bootstrap.inc on line 860. The message only displays under teaser view. Anyone got the same problem?
Comment #37
oriol_e9gYeah! Same problem and patch in #27 fixes the warning!
Comment #38
faqing commentedIf #27 fixes the warning, can we release a stable version?
Comment #39
anybody*PUSH* Did the module maintainer have a look at this?
A new releasae would be very helpful!