Closed (fixed)
Project:
ImageCache Profiles
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2011 at 06:11 UTC
Updated:
23 Oct 2011 at 20:30 UTC
I Followed the read me.txt. When i upload the image in user edit page i got the following error.
Error messageWarning: Parameter 1 to imagecache_profiles_file_validate() expected to be a reference, value given in module_invoke_all() (line 819 of C:\xampp\htdocs\mymitra\includes\module.inc).
how to solve the error.
thanks in advance.
Comments
Comment #1
jmary commentedSame here.
Comment #2
andypostTry a current version hook_file_validate() has a right signature. There's a probability that some other contrib modules is broken
Comment #4
rmatsumoto commentedSorry my bad.
dev versions works
(DLed through drush)
Comment #5
Reg commentedIt's not another module. It is getting the call from the Drupal core module_invokeall().
The fix is to remove the "&" sign which is fine because you are passing an object so it is passed by reference without the need of the sign.
If you look at the core routine called by your routine imagecache_profiles_file_validate() with the very same variable the core uses a different definition for the variable.
Your definition:
The core routine you call with the save variable:
NOTE: No "&" needed.
Fix for anyone who needs it:
Change this line
function imagecache_profiles_file_validate(&$file) {
to:
function imagecache_profiles_file_validate($file) {
you could probably also make it:
function imagecache_profiles_file_validate(stdClass $file) {
which is almost certainly the correct way to do it, I just haven't analyzed it carefully so I am hesitant to say for sure.
Comment #6
andypostThis been fixed #1043360: Warning message and disappearing pictures
Another release upcoming