CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • DB syntax error when running gift aid report
Pages: 1 [2]

Author Topic: DB syntax error when running gift aid report  (Read 5805 times)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: DB syntax error when running gift aid report
February 07, 2012, 02:14:03 am
Hey there,

I was going to bring this up tomorrow at our user group (along with direct debit) as two things that UK orgs can do to boost their profile and help the community.  LindseyM - how does that sound to you?

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: DB syntax error when running gift aid report
February 08, 2012, 04:27:33 am
I won't be at the meetup, but if I can do anything to help please count me in - I have limited development skills, so best to think in terms of doing the donkey work of pulling charities together - I have a feeling that most people who turn up to the meetups are developers and those who are paid by the charities to do stuff, rather than the charities who may not be getting on board as community members... I'm willing to take on other roles, this is just a suggestion.

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: DB syntax error when running gift aid report
February 09, 2012, 09:12:46 am
Sounds good Myles.  Michael - I've just realised that my reply earlier this week never got 'posted'.  I was asking about Alpha International's involvement in ongoing Gift Aid module maintenance as they partially funded the initial project.  Are they currently using it and willing to help maintain it?  Were they at the user group?  My knowledge of the module is non-existent as we're not planning to use it until later this year but I'm keen to be kept in the loop and to see it working.

Parvez

  • I post occasionally
  • **
  • Posts: 91
  • Karma: 7
Re: DB syntax error when running gift aid report
February 13, 2012, 12:15:38 pm
Hi All

This is Parvez from Veda Consulting. We've agreed with Michael to help support the Gift Aid module. I was involved in the original work carried out in CiviCRM and have a good understanding of how Gift Aid works.

Please contact me with your issues and we'll see if you can help get them resolved, we have a version running on 3.4.7, current task will be to iron out any bugs and port to 4.1

Thanks

Parvez

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: DB syntax error when running gift aid report
February 13, 2012, 02:32:25 pm
Wonderful.  Thanks very much Parvez.  That's great news.  Are you planning to make it compatible with Drupal 7?

Parvez

  • I post occasionally
  • **
  • Posts: 91
  • Karma: 7
Re: DB syntax error when running gift aid report
February 13, 2012, 02:57:50 pm
Yes, that'll be phase II of the work. Our first goal will be to get it stabalised and working with 4.1/Drupal 6.
 

Erawat

  • I’m new here
  • *
  • Posts: 19
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: DB syntax error when running gift aid report
February 19, 2012, 02:35:16 pm
Hi All,

Actually, I managed to get Gift Aid module work on D7/Civi 4.0.x but now If I'm now trying to make the original CiviCRM gift aid module working CiviCRM 4.1

Parvez - Is there any work or code done yet?  My company and I may be can join to be working on the Gift Aid module?


Erawat

Parvez

  • I post occasionally
  • **
  • Posts: 91
  • Karma: 7
Re: DB syntax error when running gift aid report
February 19, 2012, 10:16:43 pm
Hey Erawat

We're due to start work on this from the 27th of February. I'll touch base on the forum again with the work we are going to carry out. There are a few tweaks as well as getting the module working in terms of when a contribution should be gift aid eligible etc.

Has any of your work been contributed back to the core?

Thanks

Parvez

Erawat

  • I’m new here
  • *
  • Posts: 19
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: DB syntax error when running gift aid report
February 23, 2012, 02:04:45 pm
Quote from: Parvez on February 19, 2012, 10:16:43 pm
Hey Erawat

We're due to start work on this from the 27th of February. I'll touch base on the forum again with the work we are going to carry out. There are a few tweaks as well as getting the module working in terms of when a contribution should be gift aid eligible etc.

Has any of your work been contributed back to the core?

Thanks

Parvez

Hi Parvez

Are you going to make this happen on the code sprint?  I didn't contribute it back to the core as there is not thing change. I used Gift Aid for CiviCRM 3.3 and modified just an info for the module which was working well on CiviCRM 4.0.x/D7 but now the module is no longer working anymore. I was trying to fix it but has not yet success as I have to use my time and resource to do some other projects.

Hopefully, If they anything I can help to make this module happen. I will definitely do!!

Erawat

Parvez

  • I post occasionally
  • **
  • Posts: 91
  • Karma: 7
Re: DB syntax error when running gift aid report
February 26, 2012, 09:45:50 am
Hey Erawat,

I wont be able to attend the code sprints in London (I'm based in the UK but at client site until CiviCon).

I'm in touch with the original developers and I'll try to make a start on the issues being faced for the 4.x branches.

Thanks
« Last Edit: February 27, 2012, 09:01:59 am by Parvez »

Erawat

  • I’m new here
  • *
  • Posts: 19
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: DB syntax error when running gift aid report
February 27, 2012, 09:37:18 am
Gift Aid module has been fixed in CiviCRM 4.1/D7

Please see the updated on wiki page

http://wiki.civicrm.org/confluence/display/CRM/Gift+aid+installation,+configuration+and+usage

and the working code can be checked out at

http://svn.civicrm.org/tools/branches/v4.1/drupal/modules/civicrm_giftaid/

Thanks SRajesh for making this!!

Erawat

AliB

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: D7
  • MySQL version: latest
  • PHP version: 5.3
Re: DB syntax error when running gift aid report
March 07, 2012, 03:20:25 am
Quote from: Erawat on February 27, 2012, 09:37:18 am
Gift Aid module has been fixed in CiviCRM 4.1/D7

Please see the updated on wiki page

http://wiki.civicrm.org/confluence/display/CRM/Gift+aid+installation,+configuration+and+usage

and the working code can be checked out at

http://svn.civicrm.org/tools/branches/v4.1/drupal/modules/civicrm_giftaid/

Thanks SRajesh for making this!!

Erawat

Thank you so much! The only issue I have with this module is that the Eligible for Gift? field has exactly the same name in the GiftAid Decleration custom data used for the individual and the GiftAid custom data used for a contribution. I don't this that's supposed to be the case as CiviCRM would usually prevent two fields having the same exact name so editing any of the fields from within CiviCRM wont work as it would throw up an error.

Parvez

  • I post occasionally
  • **
  • Posts: 91
  • Karma: 7
Re: DB syntax error when running gift aid report
May 09, 2012, 04:33:20 am
Hi Guys

Below is a patch to stop the gift aid batch failing if any of the data contains single quotes or any other un escaped data

Replace the following in civicrm_giftaid/GiftAid/Utils/Contribution.php


$query = "INSERT INTO civicrm_value_gift_aid_submission
(entity_id, eligible_for_gift_aid, name, address, post_code, amount, gift_aid_amount)
VALUES ({$contributionID}, 1, '{$displayName}', '{$fullFormatedAddress}',
       '{$address['postal_code']}', {$contribution['total_amount']}, {$giftAidAmount})
ON DUPLICATE KEY UPDATE
name      = '{$displayName}',
address   = '{$fullFormatedAddress}',
post_code = '{$address['postal_code']}',
amount    = {$contribution['total_amount']},
gift_aid_amount = {$giftAidAmount}
";
                CRM_Core_DAO::executeQuery( $query );

with

                $query = "INSERT INTO civicrm_value_gift_aid_submission
(entity_id, eligible_for_gift_aid, name, address, post_code, amount, gift_aid_amount)
VALUES (%0, 1, %1, %2, %3, %4, %5)
ON DUPLICATE KEY UPDATE
name      = %1,
address   = %2,
post_code = %3,
amount    = %4,
gift_aid_amount = %5
";
                CRM_Core_DAO::executeQuery( $query,
                  array(array($contributionID, 'Int'),
                        array($displayName, 'String'),
                        array($fullFormatedAddress, 'String'),
                        array($address['postal_code'], 'String'),
                        array($contribution['total_amount'], 'String'),
                        array($giftAidAmount, 'String'),
                        )
                );

Thanks

Parvez

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DB syntax error when running gift aid report
May 11, 2012, 09:29:11 am

hey parvez:

just checked  this with the 4.1 code base and it already does the right thing (i.e. with what u patched)

any idea what version u r looking at?

Also SRajesh has ported GiftAid to a Civi Extension for 4.2, so we'll migrate to using github to manage that module going forward in 4.2

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • DB syntax error when running gift aid report

This forum was archived on 2017-11-26.