• Hello,

    When activating Amelia, I have the following error :

    Fatal error: Declaration of Symfony\Component\HttpFoundation\ResponseHeaderBag::all() must be compatible with Symfony\Component\HttpFoundation\HeaderBag::all(?string $key = null) in /app/web/app/plugins/ameliabooking/vendor/symfony/http-foundation/ResponseHeaderBag.php on line 91 Fatal error: Uncaught Error: Class "Symfony\Component\HttpFoundation\ResponseHeaderBag" not found in /app/web/app/plugins/ameliabooking/vendor/symfony/http-foundation/Response.php:205 Stack trace: #0 /app/vendor/roots/acorn/src/Illuminate/Foundation/Exceptions/Handler.php(505): Symfony\Component\HttpFoundation\Response->__construct('

    I already have HttpFoundation in my composer project. There is a conflict.
    How can I handle that ?

    Thanks ??

    • This topic was modified 2 years, 12 months ago by Axel DUCORON.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author ameliabooking

    (@ameliabooking)

    Hello Axel,

    Thank you for reaching out to us, and sorry for the late response.

    Can you tell us which plugins, which theme, and which page builder are you using so we can check it out locally?

    On the first look, it seems as if a file is missing and thus can’t be activated, but it also seems you troubleshoot this already and know it’s a conflict, so please provide us with as much info as possible so we can try replicating it locally.

    Kind regards.

    Thread Starter Axel DUCORON

    (@aksl95)

    Hello,

    I believe that it is neither a theme nor a plugin but rather my structure.
    I’m using bedrock structure which required HttpFoundation too.

    Plugin Author ameliabooking

    (@ameliabooking)

    Hi again Axel.

    Can you please comment loading of PHP classes “/symfony/http-foundation” in vendor/composer autoload, and let us know if this resolves the issue?

    Kind regards

    Thread Starter Axel DUCORON

    (@aksl95)

    Hi,

    In which side ? Amelia ? Or in my bedrock structure ?

    If it’s in amelia side, I get this error :

    in /app/web/app/plugins/ameliabooking/src/Infrastructure/WP/InstallActions/ActivationSettingsHook.php (line 316)

    'title' => [ 
        'appointment' => $savedSettings['eventTitle'],                
        'event' => '%event_name%' 
    ],

    Trying to access array offset on value of type null

    • This reply was modified 2 years, 11 months ago by Axel DUCORON.
    Plugin Author ameliabooking

    (@ameliabooking)

    Hello again

    In your last response, you mentioned you get “this error”. Are you still referring to the initial error (stackTrace) or have you tried commenting HttpFoundation in autoload with Amelia’s composer, and you received a new error that wasn’t provided in your last response?

    We can’t see the error, just the line of code where it occurred. Can you send us the StackTrace of the error?

    In short, you need to access Amelia’s folder /ameliabooking/vendor/composer/ and comment the line of code in autoload of the HttpFoundation library.

    Kind regards

    Thread Starter Axel DUCORON

    (@aksl95)

    Steps :

    1. In vendor/composer/autoload_psr4.php L18 : comment
    2. Activate plugin
    3. I get this error :

    ErrorException:
    Trying to access array offset on value of type null
    
      at /app/web/app/plugins/ameliabooking/src/Infrastructure/WP/InstallActions/ActivationSettingsHook.php:316
      at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Trying to access array offset on value of type null', '/app/web/app/plugins/ameliabooking/src/Infrastructure/WP/InstallActions/ActivationSettingsHook.php', 316, array())
         (/app/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:54)
      at Roots\Acorn\Bootstrap\HandleExceptions->handleError(2, 'Trying to access array offset on value of type null', '/app/web/app/plugins/ameliabooking/src/Infrastructure/WP/InstallActions/ActivationSettingsHook.php', 316)
         (/app/web/app/plugins/ameliabooking/src/Infrastructure/WP/InstallActions/ActivationSettingsHook.php:316)
      at AmeliaBooking\Infrastructure\WP\InstallActions\ActivationSettingsHook::initGoogleCalendarSettings()
         (/app/web/app/plugins/ameliabooking/src/Infrastructure/WP/InstallActions/ActivationSettingsHook.php:40)
      at AmeliaBooking\Infrastructure\WP\InstallActions\ActivationSettingsHook::init(false)
         (/app/web/wp/wp-includes/class-wp-hook.php:307)
      at WP_Hook->apply_filters(null, array(false))
         (/app/web/wp/wp-includes/class-wp-hook.php:331)
      at WP_Hook->do_action(array(false))
         (/app/web/wp/wp-includes/plugin.php:474)
      at do_action('activate_ameliabooking/ameliabooking.php', false)
         (/app/web/wp/wp-admin/includes/plugin.php:689)
      at activate_plugin('ameliabooking/ameliabooking.php', 'https://mysite.lndo.site/wp/wp-admin/plugins.php?error=true&plugin=ameliabooking%2Fameliabooking.php', false)
         (/app/web/wp/wp-admin/plugins.php:58)
    Plugin Author ameliabooking

    (@ameliabooking)

    Hello again.

    As far as we understand, you’re not using WordPress, correct?

    The problem is that our plugin uses WordPress functionalities, and one of those functionalities is that the Settings data is written in the wp_options table. Specifically, this:

    get_option(‘amelia_settings’)

    If you’re using Amelia outside of WordPress, this is causing the issue.

    Thread Starter Axel DUCORON

    (@aksl95)

    Hello,

    I’m using WordPress.

    I’m just using special structure named Bedrock (https://roots.io/bedrock/).

    To be precise: at the root of my WordPress project I use composer.
    My composer loads the http-foundation library.

    Amelia also uses the http-foundation library. But I think the two versions of http-foundation are different.

    I believe this is a known case as this article attests : https://graphql-api.com/blog/graphql-api-for-wp-is-now-scoped-thanks-to-php-scoper/#heading-taking-the-decision-to-scope

    Code analysis :

    Last version of http-foundation : https://github.com/symfony/http-foundation/blob/5.4/ResponseHeaderBag.php#L91

    Code used in Amelia :

    /**
    * {@inheritdoc}
    */
    public function all()
    {
        $headers = parent::all();
        foreach ($this->getCookies() as $cookie) {
            $headers['set-cookie'][] = (string) $cookie;
        }
    
        return $headers;
    }

    I don’t know if somehow you have a way to update http-foundation ?

    Thanks for help.

    Plugin Author ameliabooking

    (@ameliabooking)

    Thank you for your response.

    The last error you sent us indicates that there are no “amelia_settings” in the database table wp_options.

    Can you please check the option_name column in the database, and search for “amelia_settings”?

    Kind regards

    Thread Starter Axel DUCORON

    (@aksl95)

    Yes I have this option.

    Is not posible to debug via livechat or other ?

    We take more than a week to fix a problem that could surely be fixed in 5 minutes.

    Thanks for your help

    Plugin Author ameliabooking

    (@ameliabooking)

    Hey Axel.

    Unfortunately, we don’t have a live chat.

    If you’re using the full version of Amelia, you can open a ticket on our official support platform, and we’ll gladly help you there, just make sure to mention you’ve been forwarded from wp.org.

    Kind regards.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Foundation conflict’ is closed to new replies.