Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jul 2014 at 23:45 UTC
Updated:
12 Aug 2014 at 13:30 UTC
Jump to comment: Most recent
Comments
Comment #1
ethantHi @gwprod. Your clone command should be something like:
git clone http://git.drupal.org/sandbox/gwprod/2298383.git- users will not be able to clone your personal repo. Also, it looks you haven't set your default branch to 7.x-1.x. You need to do this, as well.
Comment #2
gwprod commentedComment #3
gwprod commentedThank you EthanT, I have corrected both of these errors.
Comment #4
gwprod commentedComment #5
gwprod commentedComment #6
gwprod commentedComment #7
gwprod commentedComment #8
gwprod commentedComment #9
gwprod commentedComment #10
ethantHey, @gwprod.
Minor stuff returned when running code sniffer relating to ajax_update.js:
I installed your module, and functionally, it works fine, but it would be helpful if you could add some specific use cases to the README, i.e., when and why this module should be used.
I would change the nested conditional you have in _ajax_update_html_id_forms_process in your .modules file - you could accomplish this with
I'd also add a link to the config page from the modules page, in your .info file, like so:
Elsewise, everything looks good.
Comment #11
ethantComment #12
ethantComment #13
gwprod commentedThanks EthanT.
Comment #14
ethantI've reviewed @gwprod's last three commits:
http://drupalcode.org/sandbox/gwprod/2298383.git/commit/ed7d1d3http://drupalcode.org/sandbox/gwprod/2298383.git/commit/0db1dc5http://drupalcode.org/sandbox/gwprod/2298383.git/commit/42606c1The issues I referenced above have all been addressed and module passes functionality testing. Would change status to "Reviewed & tested by the community," but thus far I'm the only tester - should probably have another set of eyes on this first.
Comment #15
skh commentedA couple minor things on first look. Some are more of an FYI (incase you weren't aware) and not really a release blocker:
'access callback' => 'user_access',is not necessary. That is the default callback and can be left blank.'type' => MENU_NORMAL_ITEM,$settings = variable_get('ajax_update');, you should probably have the default value as the second argument to variable_get (which also makes the next conditional unnecessary).elseon line 134 is not necessary, since it will only be reached if the first condition is not met anyway.foreach (element_children($element) as $...).Again, nothing too serious, but worth pointing out.
Comment #16
gwprod commented@skh
The javascript is a direct override of a prototype in Drupal Core's ajax api. However, I have updated the spacing and changed the conditionals to have correct braces.
If you can be more specific on the "etc", that would be great.
I have made the other changes.
Comment #17
spficklin commentedLooks good. Passed automatic pareview.sh, and conforms to the project application checklist. Switching to "Review & tested by the community". But, there are a some minor items/questions:
1) In the README.txt, in the CONFIGURATION section I think the first bullet should read something like: "Configure AJAX Update in the administration menu under Configuration -> Ajax Update -> Configuration."
2) On the configuration page there is a "Submit" button and a "Save Configuration" button. I think the "Submit" button should go away.
3) I think you might want a radio button on the configuration page to disable the functionality. Currently the only way to disable it is to disable the module. But perhaps that's good enough.
4) You might want to clarify in the documentation that not all ajax_html_ids[] are removed, just those associated with the form elements. From the tests I ran there were still some that were posted. Those look liked they were associated with the admin toolbar.
5) Can you give an example in the documentation for when this module is most useful? For example, on the form I tested, the AJAX always returned the same form elements with the same IDs (just with different values set). When AJAX was subsequently posted again the same form_html_ids looked to be submitted again. So, what is an example where different ajax_form_ids are posted differently? Is it when some form elements disappear and new ones are added?
Comment #18
gwprod commentedI think you make good points, and I will address them.
1) Good idea.
2) I will remove 'submit'.
3) The default option requires that developers explicitly enable this in their code, which I thought would implement a disabling feature; however, in retrospect, I believe that disabling it entirely, regardless, might be a good idea.
4) I agree and I will do so.
5) One of the problems with sending ajax_html_ids is that the form builder will take into account already existing ajax_html_ids even though the intent of the logic is to replace content with the same ids. This has been complained about a lot, and I've worked around it for several years. So, onto my example (which I will implement in README.txt and project description)
Suppose you have a form with add-more functionality. When you click 'add-more', the ajax-html-ids of the previous items are sent to the form builder. Because there is collision, all of the newly generated elements have different ids than they did before. But if only the new element is sent to the client, its ID may be inconsistent with the others. On the next submit, the data from the form on the page no longer corresponds to that generated by the form builder, and validation fails.
I thought of a use-case which my module would break (where multiple forms of the same type are on the same page) and I updated it accordingly so that ajax_html_ids of the parent form of the element is excluded by that element's ajax calls, but the ajax_html_ids of other forms are not.
Comment #19
gwprod commentedComment #20
mpdonadioAssigning to myself for review.
Comment #21
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 381f1bd):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Manual Review
In ajax_update_admin_form(), the variable_get() needs a default value.
The fieldset in the setting form is a little overkill. Take a look at the simpler core setting forms for inspiration.
Single quoted strings are preferred per Drupal coding standards.
So, you are monkey patching Drupal.ajax.prototype.beforeSerialize? This needs to be commented. Also note your changes.
Your indentation in the JS should be two spaces per level per Drupal coding standards.
No way to specify form IDs via the UI? Could be handy.
Your nesting / menu placement is a little weird in ajax_update_menu(). I think you can just stick this in admin/config/development with a single menu item.
You do not need the variable_set() in ajax_update_form_alter. Just rely on the default.
Were you getting notices in _ajax_update_html_id_forms_process? The first isset is overkill. Just tack the class onto the array. You also don't need the array_unique line.
It looks like the |= isn't needed since you return after a TRUE. You can likely simplify this a bit.
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.
None of this is major, and this has been RTBC for a while now.
Comment #22
mpdonadioThanks for your contribution, gwprod!
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.