I found some errors in TI module (in logic and code):

- upload directories created/checked more than once
- called taxonomy_image_delete() more than once in a single code flow
- TI cache flushed more than once in a single code flow (like above)
- wrong parameter for t() in external link check ( '@where' => @where)
- wrong (not working) call to file_save_upload(): first parameter must be a file field, "path" given instead

It's a *huge* and deep patch, with a lot of changes.
Please review.

CommentFileSizeAuthor
cleanup_taxonomy_image_module.patch9.41 KBthePanz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NancyDru’s picture

Status: Needs review » Needs work

Why are you changing form element names?

thePanz’s picture

I'm changing form elements names for better inter-operability with other hook_form() calls: each form element have a "module name" prefix like functions names and variables names.
Is it a wrong idea?

NancyDru’s picture

I didn't do that because they were all within the fieldset that already identified them.

thePanz’s picture

You're right, but take the case of an external "validator" function in another module, it will receive, in $form_values, only the form element name, and not the entire form-tree.

What do you think about other changes in my patch?
Regards, and thank you for your replies!

NancyDru’s picture

So far the only problem I see is that it says "Image upload failed" when all I do is to delete an image without adding a new one. That problem was probably already there. I fixed it.

NancyDru’s picture

Status: Needs work » Fixed

Committed. You fixed the upload problem, thanks.

thePanz’s picture

Ok, thank you for committing my changes.
I'll post some other fixes and cleanup later..

Status: Fixed » Closed (fixed)

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