Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When sites config is migrated, site URLs become hard coded #10043

Closed
duncanmcclean opened this issue May 10, 2024 · 0 comments · Fixed by #10044
Closed

When sites config is migrated, site URLs become hard coded #10043

duncanmcclean opened this issue May 10, 2024 · 0 comments · Fixed by #10044

Comments

@duncanmcclean
Copy link
Member

Bug description

I've just upgraded a site to v5 and noticed all my site URLs have become hard coded, despite being dynamic via the env() in v4.

If I didn't notice and update the site config, when I deploy to production, the site would break since all my site URLs are .test.

How to reproduce

  1. On Statamic 4, setup a multisite, with the URLs for said sites pointing at .env values:
'glasgow' => [
    'name' => 'Harvest Glasgow',
    'locale' => 'en_GB',
    'url' => env('HARVEST_GLASGOW_URL'),
    'attributes' => [
        'launch_year' => 2009,
    ],
],

'ayr' => [
    'name' => 'Harvest Ayr',
    'locale' => 'en_GB',
    'url' => env('HARVEST_AYR_URL'),
    'attributes' => [
        'launch_year' => 2021,
    ],
],

'rooted_conf' => [
    'name' => 'Rooted Conference',
    'locale' => 'en_GB',
    'url' => env('ROOTED_CONF_URL'),
],

'rooted_churches' => [
    'name' => 'Rooted Churches',
    'locale' => 'en_GB',
    'url' => env('ROOTED_CHURCHES_URL'),
],
HARVEST_GLASGOW_URL=https://harvestglasgow.test
HARVEST_AYR_URL=https://harvestayr.test
ROOTED_CONF_URL=https://rootedconf.test
ROOTED_CHURCHES_URL=https://rootedchurches.test
  1. Update to Statamic 5
  2. See that the upgrade script hard-codes the site URLs:

CleanShot 2024-05-10 at 19 37 48

Logs

No response

Environment

Environment
Application Name: Harvest Statamic
Laravel Version: 10.48.10
PHP Version: 8.3.0
Composer Version: 2.6.3
Environment: local
Debug Mode: ENABLED
URL: harvestglasgow.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file

Livewire
Livewire: v3.4.12

Statamic
Addons: 2
Sites: 4 (Harvest Glasgow, Harvest Ayr, Rooted Conference, Rooted Churches)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.0.1 PRO

Statamic Addons
duncanmcclean/static-cache-manager: 4.0.0
jonassiewertsen/statamic-livewire: 3.3.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant