Closed mofman closed 1 month ago
Seems to be CRMIntegration which are specifically affected
`
<?php
namespace eyekiller\craftfreeformextensions\Integrations\CRM\Capsule;
use Craft;
use DateTime;
use Exception;
use GuzzleHttp\Client;
use Solspace\Freeform\Attributes\Integration\Type;
use Solspace\Freeform\Attributes\Property\Flag;
use Solspace\Freeform\Attributes\Property\Input;
use Solspace\Freeform\Attributes\Property\Input\Special\Properties\FieldMappingTransformer;
use Solspace\Freeform\Attributes\Property\Implementations\FieldMapping\FieldMapItem;
use Solspace\Freeform\Attributes\Property\Implementations\FieldMapping\FieldMapping;
use Solspace\Freeform\Attributes\Property\ValueTransformer;
use Solspace\Freeform\Attributes\Property\VisibilityFilter;
use Solspace\Freeform\Form\Form;
use Solspace\Freeform\Library\Integrations\Types\CRM\CRMIntegration;
use Solspace\Freeform\Library\Exceptions\Integrations\IntegrationException;
use Solspace\Freeform\Library\Integrations\DataObjects\FieldObject;
use Solspace\Freeform\Library\Helpers\IsolatedTwig;
#[Type(
name: 'Capsule CRM',
type: Type::TYPE_CRM,
version: 'v2',
readme: __DIR__.'/README.md',
iconPath: __DIR__.'/icon.svg',
)]
class CapsuleCRMIntegration extends CRMIntegration
`
Sorry about this @mofman,
We'll check into this shortly. 🙂
Hi @mofman,
I tried reproducing this issue but for me it all works. I created a new custom integration and registered it via a custom module in the craft installation. It loads and works fine.
I see that the error you get is because the composer autoloader is incapable of finding the class in question. Is it at all possible that the namespace doesn't conform to PSR-4 standards? This could happen if you have a folder that uses different caps letters than your namespace.
Could you please send me a screenshot of the directory structure where the CapsuleCRMIntegration
is residing in? And a the code for registering it, maybe it's missing something? The integration loading part was not changed since v5.5.4
.
https://www.loom.com/share/7b65dc0a3e824dab9e769bec4d2ea8fd
`
<?php
namespace eyekiller\craftfreeformextensions;
use Craft;
use craft\base\Plugin;
use Solspace\Freeform\Events\Integrations\RegisterIntegrationTypesEvent;
use Solspace\Freeform\Library\Bundles\BundleLoader;
use Solspace\Freeform\Services\Integrations\IntegrationsService;
use eyekiller\craftfreeformextensions\Integrations\CRM\Capsule\CapsuleCRMIntegration;
use eyekiller\craftfreeformextensions\Integrations\Captchas\CloudflareTurnstile\CloudflareTurnstile;
use eyekiller\craftfreeformextensions\Integrations\Captchas\CloudflareTurnstile\CloudflareTurnstileBundle;
use eyekiller\craftfreeformextensions\Integrations\EmailMarketing\ConvertKit\ConvertKitIntegration;
use yii\base\Event;
class FreeformExtensions extends Plugin
{
public string $schemaVersion = '1.0.0';
public function init()
{
parent::init();
Event::on(
IntegrationsService::class,
IntegrationsService::EVENT_REGISTER_INTEGRATION_TYPES,
function (RegisterIntegrationTypesEvent $event) {
// CRM
$event->addType(CapsuleCRMIntegration::class);
}
);
}
}
`
`
<?php
namespace eyekiller\craftfreeformextensions\Integrations\CRM\Capsule;
use Craft;
use DateTime;
use Exception;
use GuzzleHttp\Client;
use Solspace\Freeform\Attributes\Integration\Type;
use Solspace\Freeform\Attributes\Property\Flag;
use Solspace\Freeform\Attributes\Property\Input;
use Solspace\Freeform\Attributes\Property\Input\Special\Properties\FieldMappingTransformer;
use Solspace\Freeform\Attributes\Property\Implementations\FieldMapping\FieldMapItem;
use Solspace\Freeform\Attributes\Property\Implementations\FieldMapping\FieldMapping;
use Solspace\Freeform\Attributes\Property\ValueTransformer;
use Solspace\Freeform\Attributes\Property\VisibilityFilter;
use Solspace\Freeform\Form\Form;
use Solspace\Freeform\Library\Integrations\Types\CRM\CRMIntegration;
use Solspace\Freeform\Library\Exceptions\Integrations\IntegrationException;
use Solspace\Freeform\Library\Integrations\DataObjects\FieldObject;
use Solspace\Freeform\Library\Helpers\IsolatedTwig;
class CapsuleCRMIntegration extends CRMIntegration
{
}
`
Very mystical. If you roll back to 5.5.4
it works?
I'm not sure this would be the case, but maybe the order in which the plugins are loaded changed? That shouldn't be an issue though, because all of the plugin autoload paths should be pre-built already. Could you try running composer dump-autoload
in your craft project directory?
Yes if i role back to 5.5.4 it works.
composer dump-autoload doesnt make any difference, I should also mention this is happening on multiple environments.
I attached a loom to show the breakdown https://www.loom.com/share/7b65dc0a3e824dab9e769bec4d2ea8fd
Thanks a lot for the loom. Could you show me what your PSR-4 entry is in the composer.json
for the extras plugin?
Would it be possible to make a yii module rather than a plugin, to see if there's some race condition?
I've attached a skeleton of our plugin, if you wanted to try installing? Notably there is no issues loading the captcha or the email marketing integrations.
Interesting, I ran into the very same issue. But when I implemented all of the missing methods of the CapsuleCRMIntegration
, it started running fine.
public function checkConnection(Client $client): bool
{
return true;
}
public function getApiRootUrl(): string
{
return '';
}
public function fetchFields(string $category, Client $client): array
{
return [];
}
public function push(Form $form, Client $client): void
{
// TODO: Implement push() method.
}
I implemented these four methods, could you check if any one of them is missing in your class definition? And if it is - please let me know, I might have changed something that should have been backwards compatible.
I'm very sorry, yes the ::push()
method definition has changed from
public function push(Form $form, Client $client): bool;
to
public function push(Form $form, Client $client): void;
Change its return type to void
please, this has been a bad oversight on my part.
Yes indeed changing the return type to void and removing any return statements fixes this for me.
Sorry for the inconvenience, we won't be making breaking changes in minor versions in the future.
No problem, should the exception not be alot more descriptive than it currently is, in this scenario, the current one is very misleading?
It is strangely misleading, yes, I'll see if that can be improved.
What happened?
An issue has been introduced in 5.5.5 whereby a custom integration which was working in 5.5.4 no longer works.
Reverting to 5.5.4 fixes the problem for us...
Errors and Stack Trace (if available)
How can we reproduce this?
a
Freeform Edition
Pro
Freeform Version
5.5.5
Craft Version
4.11.1
When did this issue start?
After upgrading from older Freeform version
Previous Freeform Version
5.5.4