Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 May 2013 at 13:57 UTC
Updated:
25 Aug 2015 at 11:18 UTC
Jump to comment: Most recent
Comments
Comment #1
Caseledde commentedPlease checkout Ventral. There are a lot of errors reported. Ventral is a automatic tool to review your code style and some other common issues. It will help you to maintain your module.
Comment #2
rbordallo commentedSolved, thanks.
Comment #3
Caseledde commentedHi again,
I found some issues:
1) Use files[] in .info
You may add a files attribute to your .info file.
In this way dilve_init() is obsolete.
2) dilve_settings_form_submit() is obsolete
dilve_settings_form_submit() will not be called because system_settings_form() will handle the submit.
Comment #4
rbordallo commentedHi, I think it's solved.
Thanks.
Comment #5
Caseledde commentedI was wrong:
The files[]-attribute is not the rigtht way. Its for classes and interfaces.
Sorry.
But I still think, you shouldn't use dilve_init(), because one the one hand the file will be included every time. Even its not needed. And on the other hand, hook_init() will not be called on cached pages.
So here are two other solution possibilities:
1)
1.1) Use form_load_include() in all your forms, where you need the helper functions. It should be enough to add form_load_include() to the form function. The validation and submit handler will have the file already included.
1.2) Use module_load_include() during your bulk opperations.
2)
Just delete dilve.internal.inc and move all its functions to dilve.module. This seems best for me.
Comment #6
rbordallo commentedHi,
1.2) done, this option seems cleaner and easier.
2) I have moved function to dilve.module.
I like this process, I hope to continue.
Thanks.
Comment #7
Caseledde commentedWhoops, double post.
Comment #8
Caseledde commentedGreat, but I think, you don't need module_load_include() in dilve_bulk_op(). You have to try it out.
It was meant 1) or 2).
Not 1.2) or 1.2).
I try to write better to prevent misunderstandings.
I fount some other issues:
1) '\n' dilve_bulk_form_submit().
Use PHP_EOL instead of '\n' to be multiplatform aware, because windows will use '\n\t'.
2) Form error handling in submit handler
You should do the validation in dilve_add_form_validate() only. You can validate your booktitle and isbn during the validation handler, add them to the $form_state['storage'] and let the submit handler do just the submit.
3) _dilve_fetch_data()
Maybe you should add a default case to the switch, to initialized $item as FALSE or NULL.
4) First parameter in forms
I think the first parameter already is a form array. So this look invalid for me.
Please tryout
Where do $isbn come from? I can't test it because I have no dilve access. Please validate this.
Same here:
5) Copy/Paste error in _dilve_check_settings()
6) Cleanup the code
There is a lot of commented code. Please delete those lines.
7) Re-check the functionality of the module.
Thats all for now;)
Happy coding
Comment #9
rbordallo commentedHi, sorry for the misunderstanding.
I have corrected all points (1-6) and reviewed 7.
I hope all is well!
Thanks!
Comment #10
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #11
tolivera commentedWhen you add a new book searching with "book title", if there is more than one book with the same name it returns one of them (I guess it's the first one). I think it should alert the user or alow to select from a list.
For example, try searching "Los pilares de la tierra" by name and the system returns book with ISBN 9788401338359, but you can search using other ISBN number as 9788401328510 and the system returns a different version of the book (with image in this case).
Comment #12
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #12.0
PA robot commentedI add a demo of the module.
Comment #13
keopxComment #14
keopx