This module is intended for Drupal 7 only.

https://drupal.org/sandbox/NicoleBenes/2085167

This module works on integrating Drupal and ActionKit (http://www.actionkit.com). The module currently allows for creation and use of ActionKit petition pages and donation pages on a Drupal site. With the module installed, users with the proper permissions can self-create petitions and donation pages, while still taking full advantage of ActionKit's great user tracking.

This module is still under development, and while fully functional it's in a state of constant improvement and feature addition.

Git link: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/NicoleBenes/2085167.git actionkit

Comments

Richir Outreach’s picture

Category: Support request » Task
Status: Active » Needs review
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxNicoleBenes2085167git

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.

nitesh pawar’s picture

Hi Nicole Benes,

Please do proper indentation(https://drupal.org/coding-standards ).

Check your code with https://drupal.org/project/coder module there is so many warnings.

Also 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

Richir Outreach’s picture

Code now passes review with no errors or warnings.

Richir Outreach’s picture

Status: Needs work » Needs review
rodrigoeg’s picture

Hi Nicole,

Now there are no more errors in pareview.sh: http://pareview.sh/pareview/httpgitdrupalorgsandboxnicolebenes2085167git

I've found a little error with the coder (https://drupal.org/project/coder):

actionkit.petition.inc

Line 546: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms [style_string_spacing]
  $file = file_save_data($csv->data, "public://" . $_POST["page_id"] . "-" . rand(0, 1000000) .  ".csv", FILE_EXISTS_REPLACE);

Also, as Niteshp already said, you are still using the master branch. Please, follow the steps 1, 5, and 6 of https://drupal.org/node/1127732

Manual review:

  • Array indentation in actionkit_menu() (actionkit.module) and some others functions seems to be a little different from the standard. Please, take a look on these standards: https://drupal.org/coding-standards#array
  • There are some string missing t(). Some examples:
    • actionkit.donate.inc: Missing t() on 'Thank You Message' at line 57
    • actionkit.mail.inc: Missing t() on 'Fund this campaign' at line 48
    • actionkit.petition.inc: Missing t() on 'Petition Name' at line 24
  • Theme files
rodrigoeg’s picture

Status: Needs review » Needs work
Jerimee’s picture

I'll add the translate functions to the strings. Thanks Rodrigo.

Jerimee’s picture

Added the t() functions, now I'm going to see if I can fix the array formatting.

Jerimee’s picture

I took a stab at making the js in the tpl files external, but I didn't finish. Hopefully Nicole can fix my mistakes.

http://drupalcode.org/sandbox/NicoleBenes/2085167.git/commit/cbe72d5

Richir Outreach’s picture

Split to a proper branch for Drupal, think we've fixed the errors noted above. Resubmitting!

Richir Outreach’s picture

Status: Needs work » Needs review
Richir Outreach’s picture

Fixed some Pareview errors that had cropped up, and fixed assuming field_image is declared (it might not be for non-standard install profiles).

Richir Outreach’s picture

Just thought I'd poke my head in and ask if there's anything I can do to help folks approve this module, or let me know what still needs work before it's approved. I realize we're targeting a pretty niche market here, but we would really love to get this module out of sandbox mode!

clayfreeman’s picture

Status: Needs review » Needs work

If you can fix up these last few items, your project will be in pretty good shape.

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
Review of the 7.x-1.x branch:

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.


FILE: /var/www/drupal-7-pareview/pareview_temp/includes/actionkit.general.inc
--------------------------------------------------------------------------------
FOUND 10 ERROR(S) AFFECTING 10 LINE(S)
--------------------------------------------------------------------------------
 261 | ERROR | Expected "if (...) {\n"; found "if(...) {\n"
 263 | ERROR | else must start on a new line
 272 | ERROR | Expected "if (...) {\n"; found "if(...) {\n"
 274 | ERROR | else must start on a new line
 285 | ERROR | Expected "if (...) {\n"; found "if(...) {\n"
 287 | ERROR | else must start on a new line
 299 | ERROR | Expected "if (...) {\n"; found "if(...) {\n"
 301 | ERROR | else must start on a new line
 310 | ERROR | Expected "if (...) {\n"; found "if(...) {\n"
 312 | ERROR | else must start on a new line
--------------------------------------------------------------------------------


FILE: /var/www/drupal-7-pareview/pareview_temp/js/nodeakdonation.js
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 190 | ERROR | Whitespace found at end of line
--------------------------------------------------------------------------------

Source: http://pareview.sh/ - PAReview.sh online service

Richir Outreach’s picture

Thanks Clayfreeman. I've fixed those errors and removed the master branch for real this time. If there's anything else I can do for anyone, let me know!

Richir Outreach’s picture

Status: Needs work » Needs review
Richir Outreach’s picture

Just thought I'd post again and see if there was anything that still needs to be done!

Richir Outreach’s picture

Is anyone able to take a look at this? Pretty please?

Richir Outreach’s picture

Figured I'd pop in again and see if there's anything I can do to help get this module approved!

maris.abols’s picture

Status: Needs review » Needs work

PAReview.sh test looks good now!

Just one thing found from brief code review: Do you need this block in "node--actionkit_donation.tpl.php:" ?

(function ($) { }) (jQuery);
Richir Outreach’s picture

There used to be something in there. Certainly didn't need it anymore though. It's now gone.

Richir Outreach’s picture

Status: Needs work » Needs review
znaeff’s picture

Status: Needs review » Needs work

Hi.

Git link in description is not fixed yet.
Please change
git clone --branch master NicoleBenes@git.drupal.org:sandbox/NicoleBenes/2085167.git
to
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/NicoleBenes/2085167.git actionkit

klausi’s picture

Status: Needs work » Needs review

That is not an application blocker, please do a real review of the source code.

Richir Outreach’s picture

Issue summary: View changes

Updating the git link so it doesn't confuse folks in the future.

Richir Outreach’s picture

Any chance someone could take a look at this for me? Pretty please?

leewillis77’s picture

Status: Needs review » Needs work

Hi Nicole,

I've just take a look at this, and PAreview is throwing a bunch of warnings - mainly around formatting of documentation comments - so should be pretty easy to clean up.

http://pareview.sh/pareview/httpgitdrupalorgsandboxnicolebenes2085167git

Other issues I noted from a review of the code:

  • In actionkit_uninstall() in actionkit.install.inc the comments don't match the code - see lines 150,158,161,169.
  • In actionkit.user.inc, line 20 has a hardcoded URL which should almost certainly not be, also the text here should be marked as translatable
  • In actionkit.petition.inc it looks like you're passing SQL to a 3rd party endpoint (Line 384). While this doesn't impact on the security of this module per-se I'd be severely concerned about the security of that API if it allows sites to pass it arbitrary SQL to run. You should review that URGENTLY if it's your API endpoint.
  • Also in actionkit.petition.inc, line 545 it looks like you're dumping a file into the public filesystem, can you re-assure us that the contents of that file are suitable for being available externally - it's not too clear from reading the code what that specifically contains.
  • In actionkit.general.inc, line 203 it would be nice to make this list alterable so other modules can add / amend this list. I can imagine other countries may want to change the list of words that are considered profane
  • In actionkit.donate.inc, line 217, this message contains reference to a specific donation cause - this whole block of text should be configurable / translatable and/or just updated to pull in the names correctly.
  • In theme/node--actionkit_donation.tpl.php, line 39 - these variables should all have a module-specific prefix to avoid conflicts. Ideally you should use Drupal.settings to pass these.
  • In nodeakdonation.js, line 29 it looks like you're submitting data direct to a standalone script that then bootstraps Drupal - I can't see a good reason for this rather than just submitting to a proper ajax endpoint handled through Drupal's normal menu / routing. The same applies to all of the files in the php/ folder.
  • Also in nodeakdonation.js - it looks like you're handling credit card data, but there's nothing that checks that the URLs are operating over SSL which there should be - or these details should be sent to the actionkit endpoint from JS rather than posting to a potentially insecure server.
  • Not sure what the purpose of the files in the SQL folder is - can they be removed?
Richir Outreach’s picture

I really appreciate you doing such a through review leewillis77! I'm sorry you had to waste your time with some PAreview errors. Not sure how those cropped up, but I've since fixed them.

I'm going to describe the module a little more because I think it might answer a couple of questions you and other folks might have. ActionKit is a CRM built primarily for non-profits. The developers behind it are the folks who built moveon.org. ActionKit lets you do all kinds of nifty things non-profits like to do, such as create petition pages and collect donations through pages. There's a bunch of other page types, but for the time being this module focuses on just those two. To make those pages, however, you have to be an administrator of the ActionKit account for a client. This means, obviously, that you can't do any kind of crowdfunding or crowd petitions. This module leverages Drupal and the ActionKit API to allow the public to use a client's ActionKit to create their own petition and donation pages. Think change.org, but with the ability to crowdfund also.

For the rest of your notes:

  • Fixed the comments to match the code better.
  • You are correct, that was definitely an over site. Moved it into a setting in the admin interface.
  • I don't actually have any control over the ActionKit API, but they have a lot of limits on what you can do via SQL and the API. I can only assure you that I believe they know what they are doing and have considered the ramifications of this.
  • The contents dumped to the local file system are a list of First and Last names, and a comment. Change.org lets folks download their signatures, and I feel like signing a petition online is public information. If the Drupal community feels it shouldn't be, then I think in the short term we'd just remove the functionality.
  • I think making this more general is a good feature for the future.
  • I have moved these into variables and adjusted the default text to be general.
  • I change the JS variables to actionkit_xxx and will investigate using Drupal.settings in the future.
  • The SQL files are there because ActionKit needs some queries in it's backend in order for this module to work. While the SQL code is provided in the installation file, I figured some folks might find just plain .sql files easier to work with.

Thanks again for the review!

Richir Outreach’s picture

Status: Needs work » Needs review
leewillis77’s picture

Hi Nicole,

Thanks for replying and no worries about the PAreview errors - I know how easy it is for those to crop up :)

I had a look at your comments, and the code changes you'd made. Your replies cover most things I raised - thank you for the explanation of the public file storage. On the basis of what you've said - that seems OK in the public filesystem.

I'd be nervous about marking this as RBTC while the module is posting SQL to a 3rd party endpoint, hopefully someone else will have a stronger opinion on whether that's acceptable or not. I understand that it's not something that is the fault of the module, but it might be helpful if you have any documentation that covers this to post a link here - does the 3rd party have a statement about this?

I also can't see that the following points are covered - I'd personally consider these blockers to getting this approved at least without a solid description of why it's necessary to do it this way.

  • In nodeakdonation.js, line 29 it looks like you're submitting data direct to a standalone script that then bootstraps Drupal - I can't see a good reason for this rather than just submitting to a proper ajax endpoint handled through Drupal's normal menu / routing. The same applies to all of the files in the php/ folder.
  • Also in nodeakdonation.js - it looks like you're handling credit card data, but there's nothing that checks that the URLs are operating over SSL which there should be - or these details should be sent to the actionkit endpoint from JS rather than posting to a potentially insecure server.
  • I read your notes about the files in the sql/ folder, but I'm still no clearer. It doesn't look like the module code uses them - are they just documentation? If so, they should probably be moved into documentation - either in the readme file, or an install.txt, or a documentation page on drupal.org

I've left this as "needs review" rather than setting back to "needs work" as another reviewer may have a different opinion, but I'd suggest that some more detail, or changes on those points would help.

Richir Outreach’s picture

Issue summary: View changes

Hi again leewillis77!

I'm going to address your points first:

  • Thanks for the advice here. I wish I had found this information on posting to a menu callback earlier. So much easier and better than the crap I was doing before! This should all be clean now, and I've got everything functioning and have removed the extra php files. Thanks for this!
  • This is a tricky one. The problem is that in order to submit the CC data, you have to know the API's username and password. Having that information gives the user a lot of power, so it needs to be kept pretty safe - I think this pretty much rules out being able to post directly to the API, since any JS would have to know the username and password. That'd be a worse security breach, I think. don't have a great solution other than folks shouldn't ever think about putting CC info into a form on a non-secure page. I'm happy to hear ideas!
  • I deleted all these, since they are in the install.txt file.

Much like the donation page, in order to submit a query you need to the username and password for the API. I looked into what the docs had to say about security, and for the REST API all ActionKit says is that they use basic HTML auth.

Richir Outreach’s picture

Issue summary: View changes
Richir Outreach’s picture

Turns out I can indeed submit donation requests without the API's login, so I can re-write the whole donation process to avoid ever giving the CC number to the Drupal server. I'll put those changes in and update this when I'm done!

PA robot’s picture

Status: Needs review » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2327911

Project 2: https://www.drupal.org/node/2131947

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.

avpaderno’s picture

Assigned: Richir Outreach » Unassigned
Related issues: +#2327911: [D7] Administrative Help