Topic: GS 3.1 r646 plugin-hooks

Hello everyone!
I'm using r646 RC3 and found issue with plug-in hooks.
I tried to use 'files-uploaded' back-end hook, but my function wasn't called. I didn't check other hooks, but they may be malfunctioning too.


P.S. I was trying to write a plugin, that would filter uploaded images and resize them if necessary. Is it possible to do this with 'files-uploaded' back-end hook or I should use something else?

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: GS 3.1 r646 plugin-hooks

yes your right... it seems it only fires correctly when you don't use uploadify to upload the files...

I'll log it as an issue on the bug tracker....

Currently working on The Matrix Plugin...

Re: GS 3.1 r646 plugin-hooks

n00dles101 wrote:

yes your right... it seems it only fires correctly when you don't use uploadify to upload the files...

I have this issue even with uploadify turned off. If it works without uploadify, could you please let me know about version you use.

n00dles101 wrote:

I'll log it as an issue on the bug tracker....

Thanks for that.

P.S. What about my 2nd question? Will I be able to get access to uploaded file (i.e. in $_FILES array) and to modify it before saving in uploads folder using this back-end hook?

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: GS 3.1 r646 plugin-hooks

sorry forgot to say the hook is actually called "file-uploaded"
I'll fix the documentation.

Once you fire the hook you should have access to the $_FILES array.

to test I added the following to a plugin

add_action('file-uploaded','file_upload', array());

function file_upload(){
    echo '<script type="text/javascript">alert("file has been uplaoded");</script>';
}
Currently working on The Matrix Plugin...

Re: GS 3.1 r646 plugin-hooks

n00dles101 wrote:

sorry forgot to say the hook is actually called "file-uploaded"

Thanks, working perfectly without uploadify (access to $_FILES granted). Will be waiting for fix for uploadify.

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: GS 3.1 r646 plugin-hooks

Doesn't look like its going to be easy enough..
leave it with us...

Currently working on The Matrix Plugin...

Re: GS 3.1 r646 plugin-hooks

n00dles101 wrote:

Doesn't look like its going to be easy enough..
leave it with us...

Hi!
I've just looked at the code in upload.php, sidebar-files.php and upload-uploadify.php.
Hook is firing as it should (exec_action exists and is placed where it should be), so plugin works perfectly.
As for uploadify, hook works too, but since uploadify uses AJAX all the text I try to echo in plugin will be placed in responce. And uploadify javascript doesn't handle this response text in any way, so we could not see any plugin activity unless we are using debugging.

I don't need to print something, so there's no problem for me to use this hook for my new plugin.

Thank you for quick replies and support!

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin