Automatically generating form field default value
Autofill forms module provide automatically generate defalut value for textfield, teaxarea(lorem ipsum text). checkboxs, radio buttons and select options
This module did not overwrite form field default value.
This module support which content type want to fill automatically generating default value and also textfield words length and textarea field words length.
Autofill forms module allow to configure which field want to generate autofill default value.
Installation and Configuration
Install
Download and install the Autofill forms module as normal. Just like other modules. Install modules on "sites/all/contrib/module/" folder.
Configuration
Go to admin/config/content/autofill/configure which content type want generate default value and words length also
Sandbox project page link:
https://www.drupal.org/sandbox/dnsudhakar/2542018
Pareview results:
http://pareview.sh/pareview/httpgitdrupalorgsandboxdnsudhakar2542018git
To clone the project:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/dnsudhakar/2542018.git autofill_forms
cd autofill_forms
Manual reviews of other projects
https://www.drupal.org/node/2543902#comment-10228427
https://www.drupal.org/node/2550825#comment-10233861
https://www.drupal.org/node/2567181#comment-10336285
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | autofield_sec.png | 6.82 KB | bisw |
| #18 | autofield_config.png | 32.45 KB | bisw |
| #18 | authofield.png | 36.5 KB | bisw |
| #2 | img.png | 88.04 KB | blanca.esqueda |
| create_autofill_content.png | 98.09 KB | sudhakar dhanapalan |
Comments
Comment #1
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
We 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 #2
blanca.esqueda commentedHi,
I have tested the module.
It worked perfectly for input fields.
But radio and checkbox buttons always set only one and the same value. Shouldn't this be random values?
It failed to autofill textareas.
Note: Readme file and the settings page have spelling mistakes.
Automated Review
pareview.sh : passed
Manual Review
This review uses the Project Application Review Template.
Comment #3
sudhakar dhanapalan commentedHi Blanca Esqueda,
Thanks for reviewing.
I have fixed following issues
1. Textarea field default value
2. Radio and checkbox value randomly selected.
Comment #4
falc0 commentedAutomated Review
Manual Review
instead of
in autofill_forms.module at lines 154, 143, 165, 188, ...
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #5
sudhakar dhanapalan commentedHi Falc0,
Thanks for reviewing.
I have fixed as per your recommendation issues.
Comment #6
arun ak commentedHi,
I installed and tried this module. I enable auto fill feature for Basic page content type, Please see my observation below.
Thanks,
ARUN AK
Comment #7
arun ak commentedComment #8
sheetal.nepte commentedI had installed your module and went through the functionality. I found:
Drupal core provides option to store default values for each field type in content type definition itself. I think one more module load might affect performance.
Also can you please mention how this module will be benefited to developers/editors.
Comment #9
sudhakar dhanapalan commentedHi Arun AK/sheetal.nepte,
Thanks for reviewing.
Ans: If you configure textarea field in admin site, all textarea and textarea with summary field will automatically fill default value expect default value is configured in field setting.(Please attach your screenshot)
Ans: Length of the default value (Length means words count)
Ans: Yes, Default value function is drupal core but its not generated random value, If you create more than one node, all node will display same values.
Many fields in node form you will enter manually but if you install Autofill forms module all fields fill in default value and also random text and radio/checkbox randomly selected.
Comment #10
blanca.esqueda commentedHi,
@sheetal.nepte:
I find this module useful for testing purposes.
As developer, many times we are faced to try displays, views,.. with different combination of data. And this module make it easy to save random content for selected content types.
One thing is the default value of the field, and another the automatic autofill value of the field.
And autofill can be enable/disable by content type anytime (i.e. start/end of testing).
@Sudhakar:
*I think that fields that have a parent, as field_collections, multifield, profile2,.. should be filled automatically as well. But maybe you are planing to do this later on as an improvement.
*A nice to have would be more than one size of text length for textareas and input fields. So the auto-generated content can have randomly text size as well. Same as previous point this is only a suggestion and can be a future improvement.
Comment #11
sudhakar dhanapalan commentedHi Blanca.Esqueda,
Thanks for your review.
Yes, I am plaining to release next version with autofill default value for field_collection, multifield and profile field.
Comment #12
sudhakar dhanapalan commentedComment #13
blanca.esqueda commented'Devel generate' module has the options to generate Generate dummy users, nodes, and taxonomy terms.
Specific content types and so on can be selected.
Could you le me know the main difference or final use between 'Devel Generate' and your module?
Comment #14
sudhakar dhanapalan commentedComment #15
sudhakar dhanapalan commentedHi,
@Blanca.Esqueda, Thanks for review.
Devel module support to generate entities (Node, User & Taxonomy) with random data. But my module provides provision to auto fill fields based field type and you can provide valid data for few fields or even you can modify the auto filled data. Also module provides configuration page to setup the limit for random data.
Thanks
Sudhakar D
Comment #16
sudhakar dhanapalan commentedComment #17
sudhakar dhanapalan commentedComment #18
bisw commentedHi Sudhakar,
I have checked the module and got some checklist.
1. Getting two messages after enable the module.
autofill_forms was enabled successfully. [ok]
Your Module has been successfully installed.
2. I am getting some warning in add content form(see attachments authofield.png).
3. i did set FORM FIELD SETTING section (see attachment autofield_config.png) according to instruction but i did not get the actual result(see attachment autofield_sec.png), it should content only 4 words(May be i am clear about the functionality).
Comment #19
sudhakar dhanapalan commentedHi bisw,
Thanks for reviewing.
I have fixed as per your recommendation issues.
Comment #20
sudhakar dhanapalan commentedComment #21
prashant.cHi Sudhakar,
I reviewed your module and found following issues :
1)
'#title' => $option_name,
'#title' => $node_type_name,
2) Ideally your module file permissions should be -rw-rw-r-- some of your files have permissions -rwxrwxr-x.
3) I think
in your autofill_forms_configure.admin.inc can be optimized.
Comment #22
klausiRemoving review bonus tag, you have not done all manual reviews, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.
Comment #23
sudhakar dhanapalan commentedHi,
@Prashant.c thanks for reviewing.
I have fixed as per your recommendation issues. Please review again and let me know your feedback.
Comment #24
drupalove commented@Sudhakar, priority is given to applications with a bonus review tag.
Comment #25
sudhakar dhanapalan commentedComment #26
sudhakar dhanapalan commentedComment #27
prashant.c@Sudhakar
1. I noticed that you haven't changed the file permissions yet some files still have -rwxrwxr-x permissions.
2. I haven't went into the details for what purpose you have used below code for content types check in admin configuration :
but if in case you have used it just to get the content types and check/uncheck them instead of loop through the node_type_get_names() ,you can use like :
Comment #28
klausimanual review:
But otherwise looks good to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to Ayesh as he might have time to take a final look at this.
Comment #29
ayesh commentedHi Sudhakaran,
Thanks for submitting this, and the contributions to this module.
Agreeing with Klausi, I do not see the exact distinction of this module, specially because this works only for node forms (where we have Devel module completely automating the entire node creation). I do understand that this module fills the forms for the user, instead of automating everything. This would be a great tool for demo sites, for example.
A few suggestions, but I think it would be great if you could reply to Klausi's replies first.
- In the settings form, instead of creating a bool variable for each node type, consider adding a select list with multiple options. This would leave the variable table much less complicated, and the uninstallation would be faster too.
- In the subject of uninstallation, you can use db_like in a delete query too, instead of a loop that can be a performance hit.
- Form API types are used almost everywhere, and will require a severe operation across all contribs and core to change. I don't see any immediate benefits of using constants for form API types. You can just use the string literals in the switch statement in the function that generates the values, and have a few less constants in the memory.
-
check_plain()is not required for string literals that are not use input. In the admin.inc, see line 37. That check_plain call is not really necessary, because that is already provided by the module. Node type labels' check_plain makes perfect sense though.Comment #30
sudhakar dhanapalan commented@Prashant.c, @klausi, @Ayesh Thanks for reviewing
@Prashant.c
1. File permission has been fixed
2. Changes added as recommended
@klausi
1. For testing purpose, This module is used to auto-fill the random values where the case with auto-fill the random values and manually add the real values in the node create form. Devel module generates node with random data but it doesn’t provide provision to edit the auto-filled values before it gets saved and that’s where my module comes in which provides provision to auto-fill values for certain fields, ability to edit the auto-filled values in the node create form
"why are default values not enough?"
Default value for fields would always be same for all the nodes if the user failed to edit the value while creating the node. But my module would always auto fill the random values
2. Devel module support to generate entities (Node, User & Taxonomy) with random data. But my module provides provision to auto fill the fields value in the node form based on field type. Also, you can provide valid data for few fields or even you can modify the auto filled data. Similarly Devel module also provides random data But users doesn't have option to change information which has been generated using Devel module. And auto-fill form module provides enable/disable auto-fill check option at content type/field type level with ability to the limit random data.
I have a wishlist to integrate with other entities (User & Taxonomy), Field collections and webform modules in the next release.
@Ayesh
1. Changes added as recommended
2. db_like would just delete all the module variables but the variables cache entry will not be deleted from the cache_bootstrap. If you use variable_del(), it will delete both variables and cache info. Refer this https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/variable_del/7
3. The string literals are used multiple times in the different file. if I want to edit a literal, have to edit on all the occurrences. To skip that I used string constants.
4. Changes added as recommended
Thanks
Sudhkar D
Comment #31
sudhakar dhanapalan commentedComment #32
sudhakar dhanapalan commentedComment #33
klausiThe Git commits are not connected to your user account. You need to specify an email address. See https://www.drupal.org/node/1022156 and https://www.drupal.org/node/1051722
But otherwise there were no blocking exceptions for more than a week, so ...
Thanks for your contribution, Sudhakar Dhanapalan - Drupal Geeks!
I updated your account so 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.
Thanks to the dedicated reviewer(s) as well.