This module adds a new drag and drop component that can be used when a user creates, or edits a webform.

This module offers a similar user experience to the Drag and Drop upload module https://www.drupal.org/project/dragndrop_upload - however this module isn't usable on webforms out of the box.

Project page: https://www.drupal.org/sandbox/aaronferris/2765191

Git clone: git clone --branch 7.x-1.x https://git.drupal.org/sandbox/aaron.ferris/2765191.git webform_dragndrop

Demo: http://aarontestbpnnftsaqf.devcloud.acquia-sites.com/node/1

CommentFileSizeAuthor
#15 Capture.PNG5.27 KBth_tushar
#15 Capture.PNG5.62 KBth_tushar

Comments

aaron.ferris created an issue. See original summary.

arvind.kinja’s picture

Hi aaron.ferris,
Can you add some css for padding in the file input so that when user click in the dragndrop box then a file selection dialog will be appear. Right now file selection will be appear only when user click on top left area of drag n drop box.

arvind.kinja’s picture

Status: Needs review » Needs work
aaron.ferris’s picture

Hi Arvind,

Thanks for the comment, and sure i'll add something in to cater for clicks inside the element.

Aaron

Edit: Now done and enabled on the above demo site.

aaron.ferris’s picture

Status: Needs work » Needs review
yogeshmpawar’s picture

Hi aaron.ferris,

Automated Review

Please check the errors in automatic reviews
http://pareview.sh/pareview/httpsgitdrupalorgsandboxaaronferris2765191git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not Causes module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Nothing.
  2. (+) 1. There are lots of coding standard issues which are mentioned in automatic review.
    2. It would be good, if you implement hook_help & hook_permission in your module.
  3. Just a recommendation - Nothing.

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.

This module works for me & there are no more application blockers left. so i am moving this module to RTBC.

PA robot’s picture

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.

aaron.ferris’s picture

Thanks for the above review, i'll action the comments accordingly.

aaron.ferris’s picture

I have actioned all the code review issues, with the exception of the flagged function names, as i'm under the impression this is the correct method of defining webform components. Open to suggestions/advice on this however.

Thanks.

tessa bakker’s picture

Status: Needs review » Closed (duplicate)

https://www.drupal.org/project/dragndrop_upload is looking for a new Maintainer:

Maintenance status: Seeking new maintainer

It would be better to merge your code with that module, instead of creating a new module.

scardinius’s picture

Hi Aaron,

thanks for this module. It works fine on my local site over HTTP, but when I use it on site external over HTTPS, nothing happens.

Do you have any idea what could be a reason?

Best Regards,
Scardinius

aaron.ferris’s picture

Hi @Scardinius

Can you please raise an open issue in the sandbox issue queue and ill take a look? Off the top of my head I can't think of any obvious reasons why http -> https could be causing an issue here.

https://www.drupal.org/sandbox/aaronferris/2765191

Edit: Ive just spun up a fresh D7 instance with this module using HTTPS and files upload fine and submit as expected. In the open issue can you please include any browser console errors?

Thanks
Aaron

avpaderno’s picture

Priority: Normal » Critical
Status: Closed (duplicate) » Needs review

We don't close as duplicate an application just because there is a project that is very similar. Duplication is not an application stopper, except in the case the code has been copied from an existing project.

Since it doesn't seem this is the case, I am reopening this application.

avpaderno’s picture

Priority: Critical » Normal
Status: Needs review » Reviewed & tested by the community

I didn't find any security issue in the code.

th_tushar’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +PAreview: security
StatusFileSize
new5.62 KB
new5.27 KB

Hi @aaron.ferris,

  1. There is a security issue in the module. I was able to inject javascript code through the field from module's admin configuration. See attached screenshot. I got a nasty javascript popup with "hello" message on visiting a webform page. (Security Issue)
  2. There was no link on /admin/config page, to go to module's configuration page.
aaron.ferris’s picture

Thanks, ill fix these issues.

aaron.ferris’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

If webform_dragndrop_upload_text isn't supposed to use any HTML markup, check_plain() should be used. Differently, if the value of that persistent variable is allowed to contain HTML markup, webform_dragndrop_settings() should give a description that is different from The text displayed within the drag and drop element.

If there aren't any other important issues with the code, I will take the final step in 4 hour (less or more).

aaron.ferris’s picture

Thanks for the feedback @kiamlaluno I have changed from filter_xss() to check_plain() as this variable shouldn't contain markup,.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!

I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.

I thank all the dedicated reviewers as well.

aaron.ferris’s picture

Thanks @kiamlaluno and all those that have helped with this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.