[TH] Donate

[TH] Donate 1.1.8 Patch Level 1

No permission to download
I get this error when trying to place the donation widget:

Code:
[LIST]
[*]xception: Error rendering widget: Joins only support TO_ONE relationships currently
[*]src/XF/Mvc/Entity/Finder.php:782
[*]Generated by: Smokey
[*]Sep 17, 2021 at 1:46 PM
[/LIST]
[HEADING=2]Stack trace[/HEADING]
#0 src/XF/Mvc/Entity/Finder.php(652): XF\Mvc\Entity\Finder->join('Milestones', true, false, false)
#1 src/XF/Mvc/Entity/Manager.php(147): XF\Mvc\Entity\Finder->with(Array)
#2 src/XF/App.php(2722): XF\Mvc\Entity\Manager->find('ThemeHouse\\Dona...', '1', Array)
#3 src/addons/ThemeHouse/Donate/Widget/Goals.php(57): XF\App->findByContentType('thdonate_campai...', '1', Array)
#4 src/addons/ThemeHouse/Donate/Widget/Goals.php(37): ThemeHouse\Donate\Widget\Goals->getContent()
#5 internal_data/code_cache/widgets/_52_donationgoal.php(5): ThemeHouse\Donate\Widget\Goals->render()
#6 src/XF/Template/Templater.php(7498): XF\SubContainer\Widget->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Array)
#7 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#8 src/XF/Template/Templater.php(1919): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#9 internal_data/code_cache/templates/l1/s6/public/EWRporta_articles_index.php(76): XF\Template\Templater->widgetPosition('ewr_porta_artic...', Array)
#10 src/XF/Template/Templater.php(1644): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#11 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('EWRporta_articl...', Array)
#12 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#13 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('EWR\\Porta:Artic...', 'public:EWRporta...', Array)
#14 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#17 src/XF/App.php(2344): XF\Mvc\Dispatcher->run()
#18 src/XF.php(512): XF\App->run()
#19 index.php(20): XF::runApp('XF\\Pub\\App')
#20 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
["url"] => string(1) "/"
["referrer"] => bool(false)
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
If you edit src/addons/ThemeHouse/Donate/Widget/Goals.php, find line 57:

['Milestones']

and just remove this line completely, that should sort it. I can see in XF's core code where it's triggering the error, but on my build it's querying this data as a separate query and isn't trying to do a join, so not sure why your board would be doing it differently to mine (or more, why my board isn't erroring).
 
Last edited:
If you edit src/addons/ThemeHouse/Donate/Widget/Goals.php, find line 57:

['Milestones']

and just remove this line completely, that should sort it. I can see in XF's core code where it's triggering the error, but on my build it's querying this data as a separate query and isn't trying to do a join, so not sure why your board would be doing it differently to mine (or more, why my board isn't erroring).
Sorry to bother you again. I did what you suggested (simply commented out the line) but now I get this in my admin panel:

Check completed on 8,357 files. The files listed below have contents different from those originally downloaded.

If you have edited these files yourself, you may ignore this message, otherwise you should investigate further as this may be evidence of corrupted or altered files.
[TH] Donate
src/addons/ThemeHouse/Donate/Widget/Goals.php Unexpected contents
 
Getting error since latest upgrade of XF and Donate. I was getting this before I added the AMPXF addon last night, I had cleared the error log to see if updating to 1.17 patch 1 would fix the issue or not. I was using 1.1.7 version. I added the AMPXF after all this.

Using XF 2.2.7 Patch 1

Server
PHP version 8.0.2
MySQL version 10.4.21 (10.4.21-MariaDB)
Server software nginx/1.19.3

Code:
ErrorException: Template error: [E_WARNING] Attempt to read property "currency" on null src/addons/ThemeHouse/Donate/Entity/Donation.php:264
Generated by: Unknown account Oct 14, 2021 at 11:58 AM
Stack trace
#0 src/addons/ThemeHouse/Donate/Entity/Donation.php(264): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Att...', '/home/nginx/dom...', 264)
#1 src/XF/Template/Templater.php(1191): ThemeHouse\Donate\Entity\Donation->getFormattedAmount()
#2 internal_data/code_cache/templates/l1/s89/public/thdonate_donation_macros.php(79): XF\Template\Templater->method(Object(ThemeHouse\Donate\Entity\Donation), 'getFormattedAmo...', Array)
#3 src/XF/Template/Templater.php(824): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#4 src/addons/MaZ/AMP/XF/Template/Templater.php(139): XF\Template\Templater->callMacro('thdonate_donati...', 'donation', Array, Array, Object(XF\Template\MacroState))
#5 internal_data/code_cache/templates/l1/s89/public/thdonate_user_donation_views.php(29): MaZ\AMP\XF\Template\Templater->callMacro('thdonate_donati...', 'donation', Array, Array)
#6 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), Array, NULL)
#7 src/addons/MaZ/AMP/XF/Template/XF22/Templater.php(52): XF\Template\Templater->renderTemplate('thdonate_user_d...', Array, true, NULL)
#8 src/XF/Template/Template.php(24): MaZ\AMP\XF\Template\XF22\Templater->renderTemplate('public:thdonate...', Array)
#9 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#10 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('ThemeHouse\\Dona...', 'public:thdonate...', Array)
#11 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#13 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#14 src/XF/App.php(2345): XF\Mvc\Dispatcher->run()
#15 src/XF.php(512): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
  ["url"] => string(20) "/donate/member/45658"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/donate/member/45658"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
I've been receiving donations but the donors have not been promoted to the designated user group.

How do I fix this. It worked for over a year.
 
I have a promotion set up where a donation moved a user to a no ad user group. How can I set this up so a guest can donate and see no ads?
 
I have a promotion set up where a donation moved a user to a no ad user group. How can I set this up so a guest can donate and see no ads?
You can't promote guests to a group, by definition they're not logged in so there's nothing to attach that to.
 
Fantastic add on! I just have 2 ideas/requests :)

1. It would be nice if the transaction fee was also saved against the donation record, this way it's possible to accurately calculate the incoming funds. Doesn't need to show publicly of course, but I can drag that data into my accounting software.

2. Support webhooks - so I can set a URL to be pinged when a donation is made which will be sent a post request of all the transaction details. This can then link in like above to any accounting applications :)
 
The first point is outside the scope of the addon - the payments themselves are handled by XF's payments system, and XF has no awareness of any fees incurred when using each payment provider (or doesn't store them and track the net total in any way). The same is true for user upgrades and any other purchasable item. This addon (and any other addon that uses payments for that matter) doesn't interface with the payment provider like PayPal directly, so wouldn't be able to do this. You'd need to get this information from the payment provider itself.

The same is mostly true for the second point too - the donation is created after XF has received and processed the payment webhook, so the addon doesn't directly have anything to do with the payment transaction details. It's not likely we'd be able to add that sort of feature in the near future, but should be possible to set up if you're using Stripe (PayPal I'm not sure if it supports it).
 
Last edited:
Possible bug - when using usergroup promotions, the criteria User has donated at least X amount in the past Y days doesn't take into account anonymous donations.
 
Top Bottom