Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal core provide functionality to add multiple fields into node form by using Add another Item but drupal does not facilitate to remove these field after you have added. Multiple Fields Remove Button provide this functionality by adding Remove button against each field.
SandBox: https://drupal.org/sandbox/asghar/2028623
Git: git clone --branch master asghar@git.drupal.org:sandbox/asghar/2028623.git
Comment | File | Size | Author |
---|---|---|---|
#12 | 1.png | 87.18 KB | alinouman |
multi_fields_remove_button.png | 42.4 KB | asghar |
Comments
Comment #1
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxasghar2028623git
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
asghar CreditAttribution: asghar commentedComment #3
jaffaralia CreditAttribution: jaffaralia commentedThe PAReview tool identified a few issues which need addressing:
URL: http://ventral.org/pareview/httpgitdrupalorgsandboxasghar2028623git
Please check/fix these issues before changing the status back to "needs review"
Comment #4
asghar CreditAttribution: asghar commentedComment #5
jaffaralia CreditAttribution: jaffaralia commentedMaster Branch: It appears you are working in the "master" branch in git. You should really be working in a version specific branch. See: http://drupal.org/node/1127732
Comment #6
asghar CreditAttribution: asghar commentedI have created new repository branch and push changes to that branch.
Comment #7
sprice CreditAttribution: sprice commentedThere is a very similar module called Field Remove Item. At a glance, it seems like the main difference is that your module provides a button to remove while Field Remove Item provides a checkbox. Once the checkbox is checked, then the field is removed via an Ajax Callback.
Are there more ways in which your module differs from this one?
Comment #8
asghar CreditAttribution: asghar commentedhmmm but my module support some extra functionality for https://drupal.org/project/multiple_selects .
Comment #9
asghar CreditAttribution: asghar commentedread my above comment.
Comment #10
sprice CreditAttribution: sprice commentedThat could be a good argument for differentiation. Can you write up a better explanation of how this differs from the module mentioned?
It seems like FRI might be languishing a bit in that it hasn't been updated in over a year, and there are, what seem to me to be, some pretty major issues in its issue queue.
Does your module play nicely with other commonly used modules (the FRI especially has problems with) like Field Collection and Hierarchical Select? FRI seems to also have some problems with commonly employed fields like Link, File Field, and Image Field (I'm getting all of these from its issue queue). And there is a report that it breaks things like Autocomplete Widgets.
A few places about the module review process (How to Review..., Apply for Permission..., and the Project Application Checklist) explain more about writing up how your module avoids duplication if it is similar.
Comment #11
asghar CreditAttribution: asghar commentedI have developed my module just for input fields and multiple_selects widget. Your mentioned module is not being worked perfectly so that community could not able to use this. Might be it is good argument or not but some time you need exact functionality and try to find exact match module e.g if you want to Add remove button for each fields then you will use this module and you will not prefer your mentioned module.
Thanks
Comment #12
alinouman CreditAttribution: alinouman commentedHi Asghar,
As a great co-worker that is a great effort of your to put out such an awesome module. Ok here are reviews on fresh install
1- I enabled the module and go to article content type i did not add any unlimited text field yet i got some notices.
screenshot attached.
2- Then i add an unlimited text value on article every time if i add another text value i again get these same notices
3- With views module you module is working perfectly if add or remove text values it does effect the views results so that is cool.
4-Is there is any difference with this module https://drupal.org/project/cck_multiple_field_remove?
Comment #13
asghar CreditAttribution: asghar commentedHI Ali
I have fixed your noted issues and push changes to the branch. If you face any other issue please inform me.
Comment #14
artur.martirosyan CreditAttribution: artur.martirosyan commentedHi,
I still get same notices and warnings as in #12.
Besides, I have couple of comments regarding hook_menu implementation
1. 'access callback' is set to TRUE, which I guess is not very secure.
2. file and file path seem to be unnecessary here, since form.inc would be included anyway. Any by the way, removing them makes
notices above disappear. Instead, after clicking on Remove I got another notice.
Notice: Undefined index: entity in multiple_fields_remove_button_submit_handler() (line 159 of multiple_fields_remove_button.module).
Comment #15
asghar CreditAttribution: asghar commentedHi arthgwyr
First thanks you have reviewed my module and lead me to the right direction. I have fixed notice warning message and remove unnecessary code from hook_menu e.g
For access back what you think which permission is suitable?.
Comment #16
artur.martirosyan CreditAttribution: artur.martirosyan commentedHi asghar,
After thinking about it a bit more and not being able to come up with any appropriate permission I checked the 'add_more' button processing and eventually ended up in system.module implementation of hook_menu(). I guess the system/ajax menu item was the inspiration for this part and indeed it's access callback is set to TRUE.
So it kinda seems alright to reuse what's good enough for core. But on the other hand, 'system/ajax' is not intended to be used directly. It's the entry point for handling all Ajax requests coming from '#ajax' Form API property.
So my suggestion would be to remove multiple_fields_remove_button_menu(), and use 'callback' => 'multiple_fields_remove_button_js' instead of 'path' => 'multiple_fields_remove_button/ajax' on $element['remove_button']['#ajax'] (around line 96). This is more appropriate in my opinion, as you will get cleaner code. Not only it eliminates the need for additional hook_menu and menu_item, but also multiple_fields_remove_button_js() will receive $form and $form_state as arguments, thus making first lines of it, i.e.
unnecessary as well.
Hope you find this comment useful and good luck.
Comment #17
asghar CreditAttribution: asghar commentedHello
I have refined my code and pushed changes to the branch . Thanks
Comment #18
0mni CreditAttribution: 0mni commentedLooks good, can't find anything wrong :D
Changed to "reviewed & tested by the community"
Comment #19
klausiI'll look at this now in the Project applications sprint
Comment #20
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
manual review:
But otherwise looks good, so ...
Thanks for your contribution, asghar!
I promoted this project for you: https://drupal.org/project/multiple_fields_remove_button
Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.
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.
Comment #21.0
(not verified) CreditAttribution: commentedAdd sandbox and git links