3

Has something changed recently regarding the ocalized {siteUrl} setting? I'm setting up a new localized site on MAMP PRO and the old config code I used on several other projects is throwing an error "Array to string conversion".

This works fine:

return array(
'*' => array(
    'omitScriptNameInUrls' => true,
),

'pazzo.dev' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'fileSystemPath' => '/Applications/MAMP/htdocs/pazzo/',
        'siteUrl' => 'http://pazzo.dev:8888/'
    )
),

'*.pazzo.be' => array(
    'devMode' => false,
    'cooldownDuration' => 0,
    'environmentVariables' => array(
        'fileSystemPath' => '/opt/www/pocopazzobvba/web/www.pazzo.be/',
        'siteUrl' => 'http://www.pazzo.be/'
    )
)

);

This (what I have used before) throws the error.

return array(
'*' => array(
    'omitScriptNameInUrls' => true
),
'pazzo.dev:8888' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'siteUrl' => array(
            'en' => 'http://pazzo.dev:8888/en/',
            'fr' => 'http://pazzo.dev:8888/fr/',
            'nl' => 'http://pazzo.dev:8888/'
        ),
        'fileSystemPath' => '/Applications/MAMP/htdocs/pazzo/'
    )
),
'www.pazzo.be' => array(
    'cooldownDuration' => 0,
    'devMode' => false,
    'environmentVariables' => array(
        'siteUrl' => array(
            'en' => 'http://www.pazzo.be/en/',
            'fr' => 'http://www.pazzo.be/fr/',
            'nl' => 'http://www.pazzo.be/'
        ),
        'fileSystemPath' => '/opt/www/pocopazzobvba/web/www.pazzo.be/'
    )
)

);

Am I missing something obvious??

erwinheiser
  • 850
  • 7
  • 15

2 Answers2

2

siteUrl works with an array of locales if you're using the actual siteUrl config setting. What you're currently doing is creating a separate 'siteUrl' environment variable, which places in the control panel aren't expecting to be in array format.

More good info on the different ways to set siteUrl here.

Brad Bell
  • 67,440
  • 6
  • 73
  • 143
1

So Brad, this:

'pazzo.dev' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'fileSystemPath' => '/Applications/MAMP/htdocs/pazzo/',
    ),
    'siteUrl' => array(
                 'en' => 'http://pazzo.dev:8888/en/',
                 'fr' => 'http://pazzo.dev:8888/fr/',
                 'nl' => 'http://pazzo.dev:8888/'
             )
),

is more like it then? (seems to work fine)

erwinheiser
  • 850
  • 7
  • 15