I would like to override the theme_filefield_widget_preview() function, but it seems to work only after submitting the form: right after the uploading process always the default preview shows up irrespective of the modifications.

Right now I need to change this theme function in filefield_widget.inc to make it work, but of course I don't want to do that.

Any ideas why this doesn't work?

Comments

quicksketch’s picture

Category: bug » support
Status: Active » Fixed

I'm going to go ahead and mark this fixed since I'm almost positive this will be the correct answer: You use an admin-theme that is different from your front-end theme. You need to override the template in BOTH the front-end and back-end theme, since during the AJAX request the front-end theme is used, not the back-end. This is because the AJAX upload path is not under /admin. You'll have a similar issue with any other modules that use AJAX and you override the admin output.

sgabe’s picture

Thanks Nathan, you're right. I don't know why didn't I think of this.

Status: Fixed » Closed (fixed)

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