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

jmary’s picture

Same here.

andypost’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Active » Fixed

Try a current version hook_file_validate() has a right signature. There's a probability that some other contrib modules is broken

Status: Fixed » Closed (fixed)

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

rmatsumoto’s picture

Status: Closed (fixed) » Active

Sorry my bad.

dev versions works
(DLed through drush)

Reg’s picture

It'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:

function imagecache_profiles_file_validate(&$file) {

The core routine you call with the save variable:

function file_validate_image_resolution(stdClass $file, $maximum_dimensions = 0, $minimum_dimensions = 0) {

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.

andypost’s picture

Status: Active » Fixed

This been fixed #1043360: Warning message and disappearing pictures

Another release upcoming

Status: Fixed » Closed (fixed)

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