Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 May 2013 at 07:47 UTC
Updated:
20 Aug 2013 at 22:11 UTC
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/rafal.enden/1782048.git form_placeholder
Comments
Comment #1
hardcoding commentedHi rafal,
Some things i found:
code sniffer found some warnings and errors http://ventral.org/pareview/httpgitdrupalorgsandboxrafalenden1782048git
Please add an README.txt for instructions.
Delete your master branch and add a 7.x-1.x branch. Also read this article.
Comment #2
kriboogh commentedHi rafal,
manual review:
- there is an empty form_placeholder folder inside your module
- form_placeholder.js is missing a ; at line 23
suggestion (just a personal feeling)
- make the pattern text fields a text area, so you can enter different forms each on a separate line; would make it more readable if you have long selectors for different forms;
Regards
Comment #3
hardcoding commentedComment #4
rafalenden commentedThank You for quick review.
I implemented suggested changes, also multiline selectors with textarea (thank You kriboogh).
Comment #5
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 #6
ayesh commentedFew minor suggestions (7.x-1.x branch) from a manual review:
Line 35:
user_accessis the defaultaccess callbackso it's not necessary to explicitly set it.Line 79, 86: Do we really need to set
#maxlength?Line 122: The website URL seems to be broken.
Nice work by the way. Also, I'd love if it would be possible to use some Form API property to force the form title to be a placeholder (Rather than depending on HTML5 attributes).
For an example, if I set
#jquery_placeholder => TRUE,, then this module magically hides the title (without#title_display => invisible) and sets the placeholder ?Comment #7
rafalenden commentedThank You for advice Ayesh!
Line 35: user_access is the default access callback so it's not necessary to explicitly set it.
Access callback removed.
Line 79, 86: Do we really need to set #maxlength ?
#maxlength removed.
Line 122: The website URL seems to be broken.
Author of that plugin do not maintain it anymore.
Maybe in future I will extend this module to support Drupal forms API.
Comment #8
samvel commentedHi, my manual review:
I don't know it is best practic, but i think, you may include form_placeholder.js in form_placeholder.info
All other seems good. I advise you use Review bonus system.
Good luck.
Comment #9
pagolo commentedHi rafal,
automated review:
Manual review:
the code seems to be fine.
However, to find the nit, I should:
1) improve the minimalist README.txt
2) move form_placeholder_admin_settings() to a separated file (I think)
Cheers
Comment #10
rafalenden commentedThank you for review.
form_placeholder_admin_settings()function into separate file.File jquery.placeholder.min.js is minified version so it will cause coding standard errors.
Comment #11
bulat commented1. Why are you adding
placeholderelement in JavaScript rather than processing HTML at the backend? Its a nice small module, but I think that moving transformation to one of the form hooks would be a better way of doing this. See http://drupal.org/project/placeholder.2. I don't think you should provide
jquery.placeholder.jswith the module. Require users to add it to the library folder and get it from there. Here is quote from documentation of Placeholder module:3. If you for some reason insist on JavaScript to alter HTML, I suggest using
switchfor selection control instead ofelse if.Comment #12
rafalenden commentedThanks for review bulat.
#form_placeholderproperty.if/elsewas faster thanswitch. See http://jsperf.com/switch-if-else/34Comment #13
rafalenden commentedComment #14
ayesh commentedGood job rafal. The form API changes are really nice.
Comment #15
Caseledde commentedManual review:
Code: Nothing found.
Functionality: As expected.
No issues found in manual review and issues mentioned by all the previous reviewers seems to be fixed very well.
All works fine and the drupal coding conventions inclusive usage of integrated drupal functions were well implemented, so the application status should be "reviewed & tested by the community"
Comment #16
rafalenden commentedComment #17
stborchertCould you point out the differences to similar modules (i.e. Placeholder and Compact forms)?
As we prefer collaboration over competition we want to prevent having duplicating modules on drupal.org. If the differences between your module is not too fundamental for patching an existing one, we would love to see you joining forces and concentrate all power on enhancing one module.
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away.
Comment #18
rafalenden commentedPlaceholder module
It's focused on adding new form API attribute "placeholder", with browser fallback support by jQuery, nothing more.
Compact Forms module
It's focused on making forms smaller "compact" by various kind of methods. This module don't add placeholder attribute to text fields.
My module is a mix of this two modules.
It's focused on simply and fast converting field labels to placeholders using CSS selectors.
Comment #19
ayesh commentedThanks for the clarification.
Placeholder module targets the Form API so end users who are not willing to form_alter or create forms from the scratch will find this Form Placeholder module easy to use.
One suggestion is that module names are a little confusing, don't you think? JQuery Form Placeholders or such name will make the purpose clear and distinct from the others I guess.
Comment #20
stborchertWouldn't it be better then to contribute the difference to Placeholder as a patch instead of adding just another module that "basically does the same but adds feature X" (simply spoken)?
Btw.: please don't change status back to "reviewed and tested" as the applicant by yourself.
Comment #21
rafalenden commentedI was thinking about names label_placeholder or form_placeholder, but I chosen the second one because main purpose of this module is to add placeholders at once to entire form, so the name begin with form.
Every of this modules have different approach. I think purpose of installing one instead of another is different.
Comment #22
rafalenden commentedComment #23
petu commentedHello Rafal!
Please correct the errors from automated report: http://ventral.org/pareview/httpgitdrupalorgsandboxrafalenden1782048git (add spaces).
Best regards,
Peter
Comment #24
klausiminor coding standard errors are not application blockers, please do a manual review.
Comment #25
kscheirerYou're loading quite a bit of code in form_placeholder_init() - this will be executed on every Drupal page request. Please consider only loading these files when needed (when the user is on a form page).
lib/jquery.placeholder.js (and min.js) appear to be 3rd party code. 3rd party code is not generally allowed on Drupal.org and should be deleted. This policy is described in the getting involved handbook. It also appears in the terms and conditions you agreed to when you signed up for Git access, which you may want to re-read, to be sure you´re not violating other terms.
The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.
It seems jquery.placeholder.js is still being maintained at https://github.com/mathiasbynens/jquery-placeholder. Can you use that with libraries api and include installation instructions in your README?
Setting to needs work for the library issue, otherwise this will be RTBC from me, looks very useful.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #26
ayesh commented+1 for the libraries API usage. But that library is GPL'd so no licensing issues with drupal repos I think.
Comment #27
rafalenden commentedI moved JS loading from
hook_init()intohook_process_element().JQuery plugin I used was written by Daniel Stocs (http://webcloud.se), its named the same as plugin You pointed out, but it's not the same plugin.
Anyway I added support for it through Libraries API module and removed 3rd party code form module folder.
Use of Libraries API is optional, if user don't install it, the module will not work with older browsers not supporting "placeholder" attribute.
Comment #28
rafalenden commentedComment #29
jnettikCode review looks good and the module seems to work as advertised.
I wasn't able to get this to work with webform module forms, though I think this would be more of a feature request than a bug. Still, webform is one of the top installed modules in Drupal so it might be worth adding support for it.
Comment #30
kscheirerPlease set applications to "needs work" only if there's a major issue or response required from the contributor.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #31
kscheirerLooks pretty good on review, thanks for cleaning up those issues.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #32
mlncn commentedThanks for your contribution, rafal.enden! You are now a vetted Git user. You can promote this to a full project and also create new projects as either a sandbox or a full project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
And thanks to the awesome reviewers, including hardcoding, Ayesh, pagolo, Caseledde, bulat, kriboogh, and the unstoppable kscheirer!
Comment #33
rafalenden commentedThank you everybody for advices, was very helpful.
Comment #34.0
(not verified) commentedChange Git link for non-maintainers