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

Error after converting to multisite #56

Closed
Narretz opened this issue Apr 8, 2023 · 7 comments
Closed

Error after converting to multisite #56

Narretz opened this issue Apr 8, 2023 · 7 comments

Comments

@Narretz
Copy link
Contributor

Narretz commented Apr 8, 2023

Hi, it's me again with another bug report ;)

I have a simple statamic site with a simple collection and advanced-seo enabled. After converting the site with php please multisite, I get the following error when trying to access a collection entry:

https://flareapp.io/share/omwrgWR5#F109

@aerni
Copy link
Owner

aerni commented Apr 8, 2023

You have to restructure your seo content files for multi-site as well. That's probably what's causing your issue. I suggest you create a fresh install, enable multi-site, install Advanced SEO and save some SEO site defaults in the CP. Then look at the content structure and restructure the content of your site accordingly.

@aerni
Copy link
Owner

aerni commented Apr 11, 2023

Did you get this resolved?

@Narretz
Copy link
Contributor Author

Narretz commented Apr 13, 2023

Hi @aerni I kind of got it resolved so that it works, but I'm haven't narrowed the source down 100%, because the multisite command does move advanced-seo files (as they are just content). So far it looks like the following is happening:

If you don't have a seo/site/general.yaml before converting to multisite, then advanced-seo throws this error after converting.

I want to investigate this further, but I won't have time before next week.

@Narretz
Copy link
Contributor Author

Narretz commented Apr 17, 2023

I have reproduced the error this way:

  • create a fresh statamic installation
  • add advanced-seo -> content/seo folder is not created
  • add a twitter handle in seo/social media. -> content/seo/analytics.yaml is created (why?) and content/seo/social_media.yaml
  • convert to multisite with php please multisite -> the existing content seo files are moved into the respective subfolders

-> but when opening a page, you get the above error

It's an edge case, but it's surprising nevertheless

There's also another related issue: after converting to multisite, statamic complains about duplicate ids:

/statamic-fresh/content/seo/site/social_media.yaml  
/statamic-fresh/content/seo/site/default/social_media.yaml  
/statamic-fresh/content/seo/site/en/social_media.yaml 

@aerni
Copy link
Owner

aerni commented Apr 17, 2023

I can't quite reproduce a few of the things you're mentioning.

… content/seo/analytics.yaml is created …

This file is not created for me. It's only created when I visit the Analytics defaults in the CP.

… the existing content seo files are moved into the respective subfolders

This only happens for the collections folder (it might also happen for taxonomies). The files of the site folder are not converted to multisite. It looks like Statamic is simply looking for folders by name and is converting the collections and taxonomies of Advanced SEO alongside its own collections and taxonomies folders. And the site folder is not converted because Statamic doesn't have a site folder.

There's also another related issue: after converting to multisite, statamic complains about duplicate ids:

I also can't reproduce this.

Generally, I didn't come across the exception you mentioned in your first post. I'm closing this issue, as it is not really an issue with Advanced SEO but the multisite command of Statamic. There's not much I can do to fix this issue.

@aerni aerni closed this as completed Apr 17, 2023
@Narretz
Copy link
Contributor Author

Narretz commented Apr 18, 2023

Thanks for testing!

This file is not created for me. It's only created when I visit the Analytics defaults in the CP.

Then I must have opened the page

For the other things - maybe it's a difference between Statamic 3 and 4. I tested on 3.

@aerni
Copy link
Owner

aerni commented Apr 18, 2023

I also tested on v3 😅

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

No branches or pull requests

2 participants