verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

Uninitialized string offset 0 #120

Closed nitech closed 6 months ago

nitech commented 7 months ago

Describe the bug

Going to Plugin Settings, I get this error:

image

URL is https://amatec.ddev.site/aure/postie/settings?site=amatecNorsk

Steps to reproduce

Craft Commerce 4.5.1.1

Craft CMS version

4.8.1

Plugin version

3.1.5

Multi-site?

Yes

Additional context

No response

nitech commented 6 months ago

I removed all providers inside postie.php excep Bring and then it loaded. Seems there's something wrong with the configuration of one of the providers. Here's the modified code:

    private function _getProviderTypes(): array
    {
        $providerTypes = [
            Bring::class,
        ];

        $event = new RegisterProviderTypesEvent([
            'providerTypes' => $providerTypes,
        ]);

        $this->trigger(self::EVENT_REGISTER_PROVIDER_TYPES, $event);

        return $event->providerTypes;
    }

    private function _createProvider($providerType): ProviderInterface
    {
        return new $providerType;
    } 
nitech commented 6 months ago

Seems it's the NewZealandPost::class,

engram-design commented 6 months ago

Are you able to send your config/project/project.yaml file through to support@verbb.io? I would need to replicate your project config (the saved settings for providers) for this one I believe.

hassanmah commented 6 months ago

@engram-design I'm also getting this after updating to Commerce 4.5.2 and Craft 4.8.1

I'm using "verbb/postie": "dev-craft-4 as 3.1.4.", as per https://github.com/verbb/postie/issues/119#issuecomment-1925553333

engram-design commented 6 months ago

Fixed for the next release. To get this early, run composer require verbb/postie:"dev-craft-4 as 3.1.5".

engram-design commented 6 months ago

Fixed in 3.1.6