0

First of all this question has also been posted in the AcyMailing forum. A few weeks ago (it was still on Joomla 5.1.x) the following code worked in prod without issues:

...
namespace NXD\Component\%COMPONENTNAME%\Administrator\Model;

\defined('_JEXEC') or die;

use AcyMailing\Classes\ListClass;
...

It is part of a Custom Form Field to select from the list of all available AcyMailing Lists.

It looks like after the recent AcyMailing Update 9.9.2 (idk) this code stopped working and throwing this error: Class AcyMailing\Classes\ListClass" not found

Same happens in the frontend for the UserClass (where a user gets registered onto a list after an event registration).

...
use AcyMailing\Classes\ListClass
...

I'm facing this issue on prod aswell as on staging (same server PHP 8.3.12 on a subdomain). ModSecurity aswell as the server Logs (PHP) are not showing any error at all (not even the Error 0 mentioned above).

On my Local Machine with MAMP Pro (MacOS) the same (page) version/build works without issues (copied & installed using akeeba).

I've also disabled .htaccess on my dev / staging subdomain which also did not changed a lot.

One interessting thing, From time to time the error does NOT get thrown (on Staging) whne doing a forced refresh. For example:

  • Opening first => error
  • Forced Refresh (5-10 times) always error
  • Waiting a few minutes (5 min for example) > Doing Forced refresh = no error

Joomla Config:

  • GZIP Enabled & disabled no change
  • Cache: Disabled
  • No Proxy
  • No .htaccess
  • Tried enabled / disabled SEF (but its not only frontend related so...)

Anyone any hints?

Edit based on Sharky's answer:

...
$acyHelper = JPATH_ADMINISTRATOR . '/components/com_acym/helpers/helper.php';
if (!include_once($acyHelper)) {
    $msg =  'COM_COMPONENT_FIELD_ACYM_NOT_FOUND_ERROR';
    Factory::getApplication()->enqueueMessage(Text::_($msg), 'warning');
    return false;
}
...

1 Answer 1

1

AcyMailing doesn't use Joomla's built-in autoloading. You have to include its classes manually. Simplest way to do it is to load the helper.php file which will handle the rest:

require_once JPATH_ADMINISTRATOR . '/components/com_acym/helpers/helper.php';

Additionally you should check if the file exists and bail early/throw exception if it doesn't.

1
  • Yeah I've just found that out a few seconds ago... unclear to me why it has worked all the time before...
    – Marco
    Commented Oct 19 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.