Some bugs and code cleanups

thePanz - March 10, 2009 - 22:37
Project:Taxonomy Image
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

AttachmentSize
cleanup_taxonomy_image_module.patch9.41 KB

#1

NancyDru - March 13, 2009 - 17:33
Status:needs review» needs work

Why are you changing form element names?

#2

thePanz - March 13, 2009 - 22:10

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?

#3

NancyDru - March 14, 2009 - 00:09

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

#4

thePanz - March 14, 2009 - 12:36

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!

#5

NancyDru - March 14, 2009 - 14:46

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.

#6

NancyDru - March 14, 2009 - 14:49
Status:needs work» fixed

Committed. You fixed the upload problem, thanks.

#7

thePanz - March 15, 2009 - 14:52

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

#8

System Message - March 29, 2009 - 15:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.