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.
Here's a patch on HEAD for getting petition to be Drupal 5 compatible. Testing with CiviCRM 1.6 went smoothly, but additional testing is appreciated.
Comment | File | Size | Author |
---|---|---|---|
#14 | petition_5.x_civicrm_2.patch | 20.61 KB | Owen Barton |
#12 | petition.info | 125 bytes | seanr |
#11 | petition_drupal5_3.patch | 14.05 KB | mcarbone |
#6 | petition_drupal5_2.patch | 14.05 KB | mcarbone |
#2 | petition_drupal5_1.patch | 12.32 KB | mcarbone |
Comments
Comment #1
mcarbone CreditAttribution: mcarbone commentedA .info file. (Rename w/o the .txt extension.)
Comment #2
mcarbone CreditAttribution: mcarbone commentedHere's a new patch with the following basic fixes:
1) Validation when anonymous users sign (check for existing email that's already signed or for a drupal account) -- http://drupal.org/node/74284
2) If authenticated user has already signed, present text saying that instead of form -- http://drupal.org/node/74285
Comment #3
j.q CreditAttribution: j.q commentedI patched the petition module using Cygwin and installed the petition module on my site running Drupal 5.1/PhP5.2.1 and it doesnot show up on the list of modules to enable; any idea why?
thanks.
Comment #4
j.q CreditAttribution: j.q commentedAh... I had to upload the .info file. Got it. But now I'm getting these error messages:
.../public_html/modules/civicrm/CRM/Core/Error.php, backtrace, 236
.../public_html/modules/civicrm/CRM/Core/BAO/UFGroup.php, fatal, 389
.../public_html/modules/civicrm/api/UFGroup.php, getFields, 101
.../public_html/modules/petition/petition.module, crm_uf_get_profile_fields, 532
, petition_admin_settings,
...public_html/includes/form.inc, call_user_func_array, 218
, drupal_retrieve_form,
.../public_html/includes/form.inc, call_user_func_array, 69
, drupal_get_form,
.../public_html/includes/menu.inc, call_user_func_array, 418
.../public_html/index.php, menu_execute_active_handler, 15
Any pointers? I'm using CiviCRM 1.7
thanks.
Comment #5
mcarbone CreditAttribution: mcarbone commentedDid you select a profile to use on the settings page at admin/settings/petition? I'm pretty sure that's required. (And, of course, the profile needs to be created in CiviCRM.)
Comment #6
mcarbone CreditAttribution: mcarbone commentedHere's a new patch with a couple of tweaks which you may or may not want to incorporate:
1) Include view_only civicrm profiile fields on the signatories page and in the csv. (It was omitting email for me because we have that set as view only on the user edit page, since its redundant.)
2) Include the comments field in the csv file.
3) Format dates in the csv files.
Comment #7
Jerimee CreditAttribution: Jerimee commentedI hope you are going to continue work on this . . .
some instruction on how to patch would also hit the spot.
Comment #8
j.q CreditAttribution: j.q commentedmcarbone - thanks for working on the patch.
i uploaded a patched version of the petition module and when i go to admin/settings/petition or node/add/petition i get a system error:
Sorry. A non-recoverable error has occurred.
This profile is not configured for the requested action.
these other pages turn up fine: /petition and admin/content/petition
any suggestions on how to configure the profile? also, is there a chance that you can share your patched file?
jerimee -- see this link for instructions on how to patch
http://drupal.org/node/32875
Comment #9
mcarbone CreditAttribution: mcarbone commentedj.q., check out this thread:
http://forum.civicrm.org/index.php/topic,152.0.html
You're probably butting into a civicrm restriction on that profile.
Comment #10
j.q CreditAttribution: j.q commentedThat was the problem. I activated the default profile and it all worked after that. Thanks for the tip!
I'm now testing out the module with a test petition...all seems to be working fine exept the reply email come back with all this extra code, any idea why?
"From: noreply@domain.org
Reply-to: noreply"@opensocialsites.com ["=?UTF-8?B?RnJvbTogbm9yZXBseUBibHVlbGF0aW5vcy5vcmcKUmVwbHktdG86IG5vcmVwbHk=?="@opensocialsites.com]
I found this code in line 431 in the module:
$headers = "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from";
drupal_mail('petition_mail', $form_values['email'], t($subject, $wildcards), t($message, $wildcards), $headers);
What would you change to clean up the reply email header?
Comment #11
mcarbone CreditAttribution: mcarbone commentedGood call, I missed that when changing user_mail to drupal_mail. Here's a new version of the patch with a fix.
Comment #12
seanr+1, patch appears to work well, minus a missing info file (attached).
Comment #13
hsthompson CreditAttribution: hsthompson commentedUsing drupal 5.3 and CivicRM 1.9:
First off, even when placing "petition.info" in /sites/all/modules/petition/, I don't see the petition module in Administer...Site Building...Modules...
Also, when running the patch, I get the following error:
$patch petition.module < petition_drupal5_3.patch
patching file petition.module
Hunk #11 succeeded at 597 with fuzz 1 (offset 7 lines).
Hunk #12 succeeded at 654 (offset 7 lines).
Hunk #13 succeeded at 717 (offset 7 lines).
Hunk #14 succeeded at 748 (offset 7 lines).
Hunk #15 FAILED at 759.
Hunk #16 succeeded at 776 (offset 7 lines).
1 out of 16 hunks FAILED -- saving rejects to file petition.module.rej
petition.module.rej contains:
***************
*** 691,701 ****
}
$header[] = t('Contact ID');
$header[] = t('Date Signed');
$headers = $header;
$rows = array();
- $sql = db_query(db_rewrite_sql("SELECT DISTINCT(cid), created FROM {petition_signatories} WHERE pid = %d ORDER BY created"), $arg1);
while($row = db_fetch_object($sql)){
--- 759,770 ----
}
$header[] = t('Contact ID');
$header[] = t('Date Signed');
+ $header[] = t('Comment');
$headers = $header;
$rows = array();
+ $sql = db_query(db_rewrite_sql("SELECT DISTINCT(cid), created, comment FROM {petition_signatories} WHERE pid = %d ORDER BY created"), $arg1);
while($row = db_fetch_object($sql)){
Any ideas?
Comment #14
Owen Barton CreditAttribution: Owen Barton commentedFWIW, here is a patch that includes CiviCRM 2.x support, although it still had a couple of error messages before I gave up.