The scribble module is intended to provide drupal site with a possibility to add pages that contain a drawing canvas. Visitors with the corresponding permission can then draw on this canvas and save the changes they drew on the canvas.
The idea is to provide some kind of social art sites. You could also think of a plaster on which different people write their greetings and paint their recovery wishes when u broke your leg.
The module is entity based and makes use of the entity API. A scribble entity contains information about the dimensions of the canvas, the available brushes for drawing, the background color and of course also the image snapshots.
The term snapshot describes an image that gets created once a user saves his drawing on the canvas to an image file. There are snapshots which contain only the changes of a saved drawing in a tranparent png, as well as the merged images onto which a new snapshot will be merged.
I couldn't find any similar projects on drupal.org.
The project can be found at https://drupal.org/sandbox/s_leu/2126163
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/s_leu/2126163.git scribble
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | scribble_save_ajax_access.patch | 1.83 KB | s_leu |
Comments
Comment #1
s_leu commentedComment #2
s_leu commentedComment #3
s_leu commentedComment #4
s_leu commentedAdded review for Service API module at https://drupal.org/comment/8251341#comment-8251341
Comment #5
s_leu commentedAdded a review for the Entityqueue Scheduler module at https://drupal.org/comment/8251441#comment-8251441
Comment #6
s_leu commentedAdded a review of the rublon sandbox module at https://drupal.org/comment/8251469#comment-8251469
Comment #7
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxs_leu2126163git
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 #8
ram4nd commentedSomething besides pareview.sh issues.
Comment #9
s_leu commentedApplied the proposed changes and added a description to the project page. I can't find a good example to prevent the last remaining error that is reported by pareview.sh though.
Comment #10
chalk commented@s_leu, good work!
But:
Comment #11
chalk commentedComment #12
yashsharma01 commentedHi s_leu,
This module contain drupal_mkdir($path, 0777); many times in the function scribble_prepare_folders($scribble_id) at line 451.
I think this is security issues to create directory with permission 0777 on the server any where, if i am right? Will it work with maximum 0775 permission?
Thanks,
Yash
Comment #13
s_leu commentedThanks Chalk and yashsharma01. I made the suggested changes:
Hope the module is now ready to be published :)
Comment #14
alinouman commentedHi s_leu,
1- Your configure link is wrong in info file
configure = admin/config/user-interface/scribbleIt should beadmin/config/media/scribble2- The images that are coming in slideshow are quite heavy a 500x500 is of size 758 kb it can be made of low size possibly also in jpg for more compression.
3-Background color of canvas not working in my side. Although i have given it in settings form.
Comment #15
alinouman commentedComment #16
s_leu commentedHi alinoum
Thanks for the review, nice catches. Regarding point 3 i have to say that it was never intended to change the color once you added a scribble. It's a feature that might follow but for now, the background color can only be set when adding a new scribble entity and this is working. I added a condition to deny access to the field when editing an entity.
I changed the configure path accordingly. The thing with the big png images is indeed a serious issue that needs some work. I will try to use jpg for the images and use png only for the snapshots. Thanks again.
Comment #17
s_leu commentedI finally added support for image quality and support for JPEG and JPEG quality as well. Everything is controllable via settings page from the UI. The new settings have default values that make sense, which is output as PNG at lowest quality, which will still lead to good quality of the images at small file sizes.
Comment #18
heddnThe project page should list entity as a dependency (and maybe libraries api). And there is what seems to be a security related issue. The rest of my feedback is more in the optional or question category. This project is great example the Drupal API and code standards and very close to RTBC.
scribble-brush-options.tpl:
The control statement should use the ":" alternative syntax instead of curly braces in template files. Alternatively use https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen...
scribble-slideshow.tpl:
In the same vein, rather than an almost empty scribble-slideshow.tpl, consider #prefix/#suffix render array functionality:
https://drupal.org/node/930760
Is this a hidden dependency on libraries module? I'd think you would get an error if libraries wasn't installed on a missing function definition of libraries_get_path.
Nit: comment typo. fields do not (need) to be displayed.
Instead of field_delete_field, if you only call delete instances then the last field base will automatically get deleted. However if someone uses an existing field on another content type, then this approach will break them. Not strictly important here because the field would probably break regardless, but something to consider.
js:
Miss spelling in the confirm.
Missing any sanitization on the title. That's a bit of a security issue.
function scribble_prepare_foldersMight want to make the destination for scribles more flexible so they can be stored in a private filesystem. Or maybe you don't. I think having them stored in private could get complicated and is more of an enhancement.
Typo in confirm message. Are you sure you (want) to remove.
Comment #19
s_leu commented@heddn
Thank you very much for your detailed review of the code.
I went through it and fixed the following things:
Regarding the mentioned option to make the output folder configurable and possibility to use private files directory. I basically agree, but it's something that i will implement once there is a need for it as well as an issue in the issue queue once the project is published and used.
Comment #20
heddnNothing is a blocker. However some minor feedback below. Consider using drush and coder. You can even set it up with a git pre-commit hook using drush coder-review --git.
.module:
127 | WARNING | A comma should follow the last multiline array item.
952 | ERROR | Missing parameter type at position 1
954 | ERROR | Missing parameter type at position 2
Comment #21
s_leu commentedThanks for the hint heddn. I tried to use
drush coder-review scribble --minorbut somehow it didn't find the stuff your mentioned. I fixed it anyway now.
Also made a complete code inspection and fixed some further stuff according to that.
Comment #22
s_leu commentedCan this be finally released? It's on Reviewed & tested by the community since over 5 months. Please let me know if further changes are required in order to release it.
Comment #23
pushpinderchauhan commentedGetting review bonus would help speed up the process and make sure it gets on the review admins radar.
Comment #24
s_leu commentedWhat about those reviews?
https://www.drupal.org/node/2152083#comment-8251349
https://www.drupal.org/node/2152083#comment-8251445
https://www.drupal.org/node/2152083#comment-8251471
Am i required to do more reviewing in order to get my module published?
Comment #25
s_leu commentedComment #26
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.
And please add the links to your reviews to the issue summary as requested on the review bonus page.
Comment #27
kscheirerSecurity question:
Non-blocking issues:
'#required' => TRUEthen you don't need the empty checks in the validate functionsAssigning to klausi for the security question, otherwise this is ready to go from me!
Comment #28
klausiAs far as I can see scribble_save_ajax() is no a security risk, since it just saves uploaded data to an image file. That is basically the same as uploading a file over a file field widget.
I'm more concerned about the scribble ID which also directly comes from $_POST and is never validated. What characters are allowed in a scribble ID? That should be checked before using it in a filename. I'm not sure how that could be exploited exactly, but you can come up with some ideas like '../../../../somewhere' and try to build an attack from that. Can you validate the scribble ID before doing the file processing?
Comment #29
s_leu commentedThanks a lot for the heads up on this one. I fixed that now, see the attached patch. I will also fix the additional points mentioned in #27. I'm assigning back to you kscheirer as you seem to be in charge to finally give me permission to release my project?
By the way i got some question. Somehow all commits are credited to my former username DrupOn, which i'm actually not using anymore. Also the ssh key i used to push commits to the scribble repository is on my user account (s_leu). Is there a possibility to move the commits to the s_leu account? If so how can i accomplish this?
Comment #30
s_leu commentedComment #31
kscheirerThanks for those updates! Normally we ask that you don't RTBC your own issues, but the changes were small and this application has been around too long already. I'm not sure how to move credit from one git account to another, maybe this will help? http://stackoverflow.com/questions/3042437/change-commit-author-at-one-s....
Thanks for your contribution, s_leu!
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.