The SN Quick Field Delete module allows site admin to delete multiple fields simultaneously in quick and efficient manner on 'Manage field' page.
Sand Box Link : https://drupal.org/sandbox/gaurav.pahuja/2081279
Git Repository : http://git.drupal.org/sandbox/gaurav.pahuja/2081279.git
Motivation for writing this module came while deleting multiple fields (around 35) for a particular content type which is quite cumbersome process.
GIT Clone command: git clone http://git.drupal.org/sandbox/gaurav.pahuja/2081279.git sn_quick_field_delete
Modules that I reviewed:
https://drupal.org/node/2088341#comment-7865041
Comment | File | Size | Author |
---|---|---|---|
#10 | sn_quick_field_delete.png | 40.46 KB | Martin Schauer |
Comments
Comment #1
alexmoreno CreditAttribution: alexmoreno commentedGood morning gaurav.pahuja,
please include:
Apart from that, the module itself has some things to correct to follow the coding standars:
Comment #2
SanduCiprian CreditAttribution: SanduCiprian commentedThe ideea for this module is good.
I tested and it's a problem with the article node type. With other content types works fine.
As a suggestion: you can put a confirmation page when you delete some fields.
Comment #3
joshi.rohit100Hi @gaurav.pahua,
please mention the hook type in comment for function "sn_quick_field_delete_form_field_ui_field_overview_form_alter" i.e. hook_form_FORM_ID_alter().
Also mention the in the comment that function "sn_quick_field_delete_multi_delete_submit" is a submit handler for the which form so that whoever view the code, get it easily.
Comment #4
gaurav.pahuja CreditAttribution: gaurav.pahuja commentedurwen, SanduCiprian & joshi.rohit100,
All review comments have been incorporated. Please review.
Thanks,
Gaurav
Comment #5
PA robot CreditAttribution: PA robot commentedProject 1: https://drupal.org/node/2083109
Project 2: https://drupal.org/node/2070535
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
PA robot CreditAttribution: 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.0
PA robot CreditAttribution: PA robot commentedgit clone command added.
Comment #7
gaurav.pahuja CreditAttribution: gaurav.pahuja commentedAdding PAReview tag.
Comment #8
swim CreditAttribution: swim commentedHey Gaurav,
I couldn't find any release blockers however a few points to note.
function sn_quick_field_delete_form_field_ui_field_overview_form_alter, why are you including the form_id argument?
In your form submit function, line 94 you're using field_purge_batch with a static argument. What happens if the number of deleted field records are larger than the static value?
Cheers,
Comment #9
gaurav.pahuja CreditAttribution: gaurav.pahuja commentedHi,
First review comment incorporated.
field_purge_batch just purges a batch of deleted Field API data and it should have a low batch limit.
From its documentation
/**
* Purges a batch of deleted Field API data, instances, or fields.
*
* This function will purge deleted field data in batches. The batch size
* is defined as an argument to the function, and once each batch is finished,
* it continues with the next batch until all have completed. If a deleted field
* instance with no remaining data records is found, the instance itself will
* be purged. If a deleted field with no remaining field instances is found, the
* field itself will be purged.
*
* @param $batch_size
* The maximum number of field data records to purge before returning.
*/
Comment #10
Martin Schauer CreditAttribution: Martin Schauer commentedHi gaurav.pahuja!
I had a look at this project, here is a list of my findings.
- If the module "field_groups" is in use, the field-list-table gets corrupted as you can see on the attached screenshot. Deleting still works perfectly, but as this problem is frequently used, you should consider searching for a solution to this display-issue.
- Way more important: There has to be any kind of confirmation, if submitting a form would delete fields without any way of undoing that action. A checkbox can be checked by mistake and therefore this really is a security-issue. May it be a simple JavaScript-confirmation-diloag "Are you sure you want to delete fields "field_1" and "field_2" in Content Type "CT1"?" or something more complex, if any of these checkboxes are checked, but something has to be added.
- This project does not come up with paragraph 2.3 in the project application checklist (as quoted below), but as this project is really helpful, well done, and can be easily extended in the future, I hope the final reviewer will not be too strict here.
- Coding standards seem to be fine, the automated review-tools didn't find anything, neither did I, well done!
As soon as the confirmation-mechanism is added, this module should be ready for the RTBC-status.
regards,
Martin
Comment #11
Martin Schauer CreditAttribution: Martin Schauer commentedComment #12
gaurav.pahuja CreditAttribution: gaurav.pahuja commentedJS confirmbox added.
Comment #13
Martin Schauer CreditAttribution: Martin Schauer commentedOkay, you added a really-hard-to-read JavaScript one-liner, but it does what it is supposed to do, so on the security-side this looks a lot better now.
The string "Are you sure you want to delete selected fields?" should be made translatable by using t(), but that's something uncritical and easy to do, so I guess a pro-reviewer should have a look now.
Comment #14
kscheirerCode looks fine, nice module. Can you add some more detail to your project page?
Thanks for your contribution, gaurav.pahuja!
I updated your account to let you 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 get 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.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #15.0
(not verified) CreditAttribution: commentedAdded modules those were reviewed.
Comment #16
klausiRemoving unused tag.