Webservices request gets reply 'Class "DonationHelper" not found''
Moderators: ooffick, General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Enthusiast
- Posts: 139
- Joined: Tue Feb 28, 2006 3:23 pm
Webservices request gets reply 'Class "DonationHelper" not found''
JoomDonation is a 3rd party extension and "DonationHelper" comes with that extension. Since a recent update to that extension I've been unable to use Webservices on the site - get this message
Class "DonationHelper" not found
JoomDonation (com_jdonation) does not implement any Webservices. I can't see how a webservices request could possibly get tangled up with com_jdonation. The com_jdonation directory under api/components is EMPTY.
Does anybody have any suggestions for how to track down the source of this problem?
thank you in advance.
Class "DonationHelper" not found
JoomDonation (com_jdonation) does not implement any Webservices. I can't see how a webservices request could possibly get tangled up with com_jdonation. The com_jdonation directory under api/components is EMPTY.
Does anybody have any suggestions for how to track down the source of this problem?
thank you in advance.
- toivo
- Joomla! Master
- Posts: 17506
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Webservices request gets reply 'Class "DonationHelper" not found''
Turn on the option 'System Debug' in the System tab of the Global Configuration. Enable the plugin 'System - Debug'. Those settings will hopefully give a more detailed message that will identify the script where the error occurs and display the PHP call stack, the classes and function calls leading to the error.
Toivo Talikka, Global Moderator
-
- Joomla! Enthusiast
- Posts: 139
- Joined: Tue Feb 28, 2006 3:23 pm
Re: Webservices request gets reply 'Class "DonationHelper" not found''
I had already tried that. I see nothing at all reported in the site error_log file when I get that response. Apparently it isn't an "error".
- toivo
- Joomla! Master
- Posts: 17506
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Webservices request gets reply 'Class "DonationHelper" not found''
Then the origin of the error could simply be the script that calls the Joomla core API through web services. Does that script create its own class map?
Toivo Talikka, Global Moderator
-
- Joomla! Hero
- Posts: 2962
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Webservices request gets reply 'Class "DonationHelper" not found''
Report to developer or post contents of administrator/components/com_jdonation/loader.php file.
-
- Joomla! Enthusiast
- Posts: 139
- Joined: Tue Feb 28, 2006 3:23 pm
-
- Joomla! Enthusiast
- Posts: 139
- Joined: Tue Feb 28, 2006 3:23 pm
Re: Webservices request gets reply 'Class "DonationHelper" not found''
administrator/components/com_jdonation/loader.php
Code: Select all
<?php
/**
* @version 5.6.0
* @package Joomla
* @subpackage Joom Donation
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2009 - 2024 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die();
use Joomla\CMS\Factory;
/**
* Reregister prefix and classes for auto-loading
*/
JLoader::registerPrefix('OSF', JPATH_ADMINISTRATOR . '/components/com_jdonation/libraries/osf', false, true);
JLoader::registerPrefix('Donation', JPATH_BASE . '/components/com_jdonation',false, true);
JLoader::register('os_payments', JPATH_ROOT . '/components/com_jdonation/payments/os_payments.php');
JLoader::register('os_payment', JPATH_ROOT . '/components/com_jdonation/payments/os_payment.php');
if (Factory::getApplication()->isClient('administrator'))
{
JLoader::register('DonationHelper', JPATH_ROOT . '/components/com_jdonation/helper/helper.php');
JLoader::register('DonationHelperHtml', JPATH_ROOT . '/components/com_jdonation/helper/html.php');
JLoader::register('DonationHelperBootstrap', JPATH_ROOT . '/components/com_jdonation/helper/bootstrap.php');
JLoader::register('DonationHelperCryptor', JPATH_ROOT . '/components/com_jdonation/helper/cryptor.php');
// Register override classes
$possibleOverrides = [
'DonationHelperOverrideHelper' => 'helper.php',
];
foreach ($possibleOverrides as $className => $filename)
{
JLoader::register($className, JPATH_ROOT . '/components/com_jdonation/helper/override/' . $filename);
}
}
else
{
//Front-end, we will re-use some controllers and models from back-end
JLoader::register('DonationControllerDonor', JPATH_ADMINISTRATOR . '/components/com_jdonation/controller/donor.php');
JLoader::register('DonationModelCampaigns', JPATH_ADMINISTRATOR . '/components/com_jdonation/model/campaigns.php');
JLoader::register('DonationModelDonors', JPATH_ADMINISTRATOR . '/components/com_jdonation/model/donors.php');
JLoader::register('DonationModelPlugins', JPATH_ADMINISTRATOR . '/components/com_jdonation/model/plugins.php');
}
if (DonationHelper::isJoomla5())
{
JLoader::registerAlias('JDatabaseQuery', \Joomla\Database\DatabaseQuery::class);
// Force autoload class to make it available for using
class_exists('JDatabaseQuery');
}
if (version_compare(JVERSION, '4.0.0-dev', 'ge'))
{
$db = Factory::getDbo();
$db->setQuery("SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));");
$db->execute();
}
class JoomdonationHelper extends DonationHelper
{
}
Code: Select all
< * @copyright Copyright (C) 2009 - 2024 Ossolution Team
---
> * @copyright Copyright (C) 2009 - 2023 Ossolution Team
28,37d27
<
< // Register override classes
< $possibleOverrides = [
< 'DonationHelperOverrideHelper' => 'helper.php',
< ];
<
< foreach ($possibleOverrides as $className => $filename)
< {
< JLoader::register($className, JPATH_ROOT . '/components/com_jdonation/helper/override/' . $filename);
< }
-
- Joomla! Hero
- Posts: 2962
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Webservices request gets reply 'Class "DonationHelper" not found''
Try changing this line:
to this:
Code: Select all
if (Factory::getApplication()->isClient('administrator'))
Code: Select all
if (!Factory::getApplication()->isClient('site'))
- Kubik-Rubik
- Joomla! Explorer
- Posts: 272
- Joined: Wed Aug 25, 2010 1:59 pm
- Location: Karlsruhe - Germany
- Contact:
Re: Webservices request gets reply 'Class "DonationHelper" not found''
Hey David,davidascher wrote: ↑Mon Apr 15, 2024 11:24 amHowever, I still don't understand how a webservices call could ever get to this file - or any file in this component.
Components in the API call do trigger plugin events. If a plugin from this extension (e.g., a content plugin for the article component) is listening to the called event (e.g., onContentPrepare event), then it is loaded, and it can do many incomprehensible things, like calling classes that were not loaded correctly.
Try to disable plugins from the mentioned extension and rerun your API call.
Cheers
Viktor
Kubik-Rubik Joomla! Extensions https://kubik-rubik.de
Former member of Joomla! Production Leadership Team, Security Strike Team and Bug Squash Team
Viktor
Kubik-Rubik Joomla! Extensions https://kubik-rubik.de
Former member of Joomla! Production Leadership Team, Security Strike Team and Bug Squash Team
-
- Joomla! Enthusiast
- Posts: 139
- Joined: Tue Feb 28, 2006 3:23 pm
Re: Webservices request gets reply 'Class "DonationHelper" not found''
That did the trick! I hope I can fix something for you someday!SharkyKZ wrote: ↑Mon Apr 15, 2024 4:47 pmTry changing this line:
to this:Code: Select all
if (Factory::getApplication()->isClient('administrator'))
Code: Select all
if (!Factory::getApplication()->isClient('site'))
-
- Joomla! Hero
- Posts: 2962
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Webservices request gets reply 'Class "DonationHelper" not found''
By the way, should report this issue to the developer, if you haven't done that already. Otherwise your changes will be lost on update.
- Kubik-Rubik
- Joomla! Explorer
- Posts: 272
- Joined: Wed Aug 25, 2010 1:59 pm
- Location: Karlsruhe - Germany
- Contact:
Re: Webservices request gets reply 'Class "DonationHelper" not found''
Maybe just a quick explanation of why this solved the problem:
If the call is triggered via API, the application client name is api. In the initial check, the first condition is never met, and the registration of the called classes is skipped. In the proposed solution, the check is against the second condition, so the client name api does meet the first condition, and the required classes are registered.
If the call is triggered via API, the application client name is api. In the initial check, the first condition is never met, and the registration of the called classes is skipped. In the proposed solution, the check is against the second condition, so the client name api does meet the first condition, and the required classes are registered.
Cheers
Viktor
Kubik-Rubik Joomla! Extensions https://kubik-rubik.de
Former member of Joomla! Production Leadership Team, Security Strike Team and Bug Squash Team
Viktor
Kubik-Rubik Joomla! Extensions https://kubik-rubik.de
Former member of Joomla! Production Leadership Team, Security Strike Team and Bug Squash Team