Closed (fixed)
Project:
CiviCRM Subscribe
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
21 Apr 2008 at 22:49 UTC
Updated:
14 Dec 2023 at 07:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tostinni commentedVersion 1.2 doesn't support the version 2.0 of CiviCRM so you have to apply this patch:
http://drupal.org/node/235904#comment-779724
Comment #2
Anonymous (not verified) commentedOK, thanks tostinni.
Comment #3
tjcook commentedI got this exact error after fresh install of D6 dev build
Comment #4
EvanDonovan commentedThe patches in #235904: CiviCRM 2.0 compatibility work against the 5.x version of the module. They are not compatible with 6.x. If I have time, I may create a patch for 6.x, now that I see what needs to be done. It's just tedious more than anything else.
Comment #5
EvanDonovan commentedNote that to make the patch compatible with CiviCRM 2.2, the function has been changed (yet again) to civicrm_group_get (cf. the Group API documentation).
Comment #6
EvanDonovan commentedActually, there are many changes between the APIs for CiviCRM 1.x and CiviCRM 2.1+. I haven't yet been able to get a working version of this module, but at least this one doesn't give function not found errors.
Comment #7
EvanDonovan commentedOk, here's a patch of CiviCRM Subscribe that worked for me. It uses the CiviCRM API as mentioned in #415232: Migrating to CiviCRM 2.2, although the civicrm_subscribe() function and related functions mostly work as well.
All you would need to do to test out the civicrm_subscribe() function (and the drupal_mail functionality) would be to switch which part of civicrm_subscribe_form_submit() is commented out. Note that the token substitution is not currently working in the drupal_mail functionality, which is why I switched to the CiviCRM API (not to mention that it's just simpler).
Note that you will have to make sure your groups are publicly visible in CiviCRM if you want the subscribe to work successfully.
Please test this patch so we can get it or something similar committed to the 6.x branch of CiviCRM Subscribe. The 6.x branch is completely broken as it is.
Comment #8
EvanDonovan commentedAlso, I just saw that menu strings shouldn't be wrapped in t(). So that would need fixing too, but it's trivial.
Comment #9
rpalomo commentedI created a patch based on the original released dev version, that means includes your changes.
I also commented out in the form to get first and last names, and commented the other mail settings in the configuration. I Guess if you want to support drupal mail that has to come back, but in the mean time this works good.
Comment #10
pelicani commentedThis works, after a couple tweaks.
1. civicrm_subscribe_block needed to initialize civicrm and require the v2/Group.php
2. civicrm_subscribe_admin_settings needed to require the v2/GroupContact.php
Comment #11
EvanDonovan commentedAfter applying pelicani's tweaks, the patch in #9 works for me. I'll try to re-roll the patch soon, when I have time.
Also note, however, what I said in #415232-7: Migrating to CiviCRM 2.2: you have to set your groups' visibility to Public if you want them to be subscribable, as per CRM-1797.
Comment #12
berenddeboer commentedAnd here an updated patch. It's #9 + comments from #11. It would be nice to have first name/last name working again, but don't know yet how to do it.
PS: is this module abandoned?
Comment #13
EvanDonovan commented@berenddeboer: Yes, I think this module is abandoned, I think. At least, I was the last person to make a patch for 2.1+ compatibility.
In CiviCRM 3.x, you should be able to meet all your CiviCRM subscription needs by using CiviCRM profiles in user registration or user edit. I don't know if the blocks functionality has any equivalent in CiviCRM 3.x though.
Comment #14
EvanDonovan commentedI am going to mark this RTBC since it can't hurt to get a working version of the module. douggreen is the only one with commit access. I'll see if I can ping him on IRC to just commit it real quick, for the few of us who still use the module :)
By the way, dlobo (CiviCRM development lead) said on IRC:
is it possible to get people into groups that are not publicly visible now?
via the api probably yes via the UI / civi generated forms, probably noSo if you are running CiviCRM 3.x, you should actually be able to use CiviSubscribe to subscribe people to groups that won't show in the CiviCRM-generated forms (which actually means that this module has found a new reason for life).
I'll soon have occasion to test whether dlobo's correct about this. I'll try to update you on my results.
Comment #15
EvanDonovan commentedI've offered to take over maintainership: #765056: Offering to take over maintainership of the CiviCRM Subscribe module.
I have tested what dlobo said and, yes, you can use CiviSubscribe to subscribe to groups that you don't make visible in the CiviCRM interface. So, yay, this module still have a reason for being!
Comment #16
EvanDonovan commentedI just took over maintainership. I'll try to commit this patch and make a new release shortly, as soon as I figure out how to use Drupal's CVS system.
Comment #17
EvanDonovan commentedI actually am planning to re-roll this patch soon, since it has some glaring code style issues visible via Dreditor. I'll have to run the whole module through Coder.module. It should still work functionally though.
Since I'm going away for my wedding next week :), I'm afraid I probably won't have a chance to commit a re-rolled patch until mid-June.
Comment #18
EvanDonovan commentedHere is a patch against a CVS checkout of the 6.x-1.x with code style fixes. It should behave the same as the previous patch.
Once it's marked RTBC, or within the next few days, whichever is sooner, I will commit it to HEAD and the 6.x-1.x branch, and release a beta of 6.x-1.x.
Then we can discuss what things might be good to change or clean up prior to a full release.
Sorry that this took so long for me to get around to do.
Comment #19
EvanDonovan commentedMany apologies for taking so long to commit this - it was my first time doing CVS (especially on drupal.org) and I was scared :)
I tested it myself today on a local install and it successfully added me to a public group. It failed with a very generic error message ("Subscription error"), however, when I tried adding to a hidden group. I think that is due to the DAO group add function which is called by the CiviCRM API wrapper.
There are obviously many improvements that could be made to this code, such as the ability to add to private groups, the ability to collect more data, subscription blocks, CAPTCHA, etc., but I'll add those later. Hopefully, I'll have the time - this has been on the back burner for quite a while.
Please upgrade to the 6.x-1.0-beta1, deleting the code you currently have first, and report back if there are issues. I plan on fixing any bugs prior to a full 6.x-1.0 release, then adding features in either 6.x-1.1, or 6.x-2.0, depending on how much of a change it is.