nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
162 stars 68 forks source link

First link of sitemap index is invisible and empty #1442

Closed valboivin closed 3 months ago

valboivin commented 3 months ago

Describe the bug

The sitemap index table indicates that there's one section, but the label and href are empty. If I go directly to this section sitemap, I can see that it is well generated.

I've tried multiple times to regenerate the general sitemap with the same result. Also, I've tested adding an additional individual URLs to the sitemap index. After this, I could see my original section sitemap link, but my additional URL was now in turn being invisible.

To reproduce

Steps to reproduce the behaviour:

  1. Generate the sitemap of the website
  2. Make sure that there's at least one section with sitemap urls generated
  3. The first line of the sitemap table will be unclickable (with the last updated date well visible)

Expected behaviour

The link to the section sitemap needs to visible and clickable.

Screenshots

screenshot 2024-03-27 at 8 52 07 AM

screenshot 2024-03-27 at 8 52 14 AM

screenshot 2024-03-27 at 9 04 06 AM

Versions

valboivin commented 3 months ago

Edit I've overlooked at the sitemap with the 2 URLs. Seems like the invisible one is still the one for my pages section. So it's not "the first" link that is problematic, but a specific one.

valboivin commented 3 months ago

I've been able to make my link reappeared, but I don't feel like it's truly fixed. I've got some more insights about this in case anyone has the same issue.

My problematic section is "Pages" and we have a couple of different entry types. Some of them have the "sitemap enabled" setting toggled on and some of them have it off.
I've enabled the sitemap for all entry types. My section link finally showed again in the sitemap index. Then, I've disabled once again the sitemap setting for the entry types we didn't want. It's just really odd. I've tried switching only one entry type and It didn't work. Seems like the only thing that worked was enabling all of them. And still, for some environments, as soon as one of my entry types is disabled, the link becomes invisible again.

khalwat commented 3 months ago

How do you have the sitemap enabled toggled on or off via in some of these sections? Is it via SEOmatic -> Plugin Settings -> Content SEO or is it via an SEO Settings field?

valboivin commented 3 months ago

It is in SEOmatic -> Plugin Settings -> Content SEO, through the entry types dropdown.

screenshot 2024-03-27 at 1 04 20 PM
khalwat commented 3 months ago

So there actually should be a separate sitemap for each entry type. Have you checked to see if there are multiple sitemaps for this section, one for each entry type?

valboivin commented 3 months ago

There's only one sitemap for the whole "Pages" section and not one for each entry type. All URL from pages of different types are in the same sitemap.

khalwat commented 3 months ago

Can you please provide me with a live URL to your sitemap index?

valboivin commented 3 months ago

This is the working one: https://www.galleri.com/sitemaps-1-sitemap.xml

However, all the page links starting with /get-started are using a different entry type and they should not be there. But, if I toggled off this entry type and some others, the sitemap bug reappears. Overall, in the list generated for the Pages section, there are about 4 different entry types.

valboivin commented 3 months ago

If you need a link with the broken sitemap, just let me know and I'll disable some entry types sitemap and invalidate our Cloudfront cache.

khalwat commented 3 months ago

I can take a look at it with you if you like; I feel like there may be something not quite right here.

Book a time for a video conference:

https://savvycal.com/nystudio107/chat

valboivin commented 3 months ago

Perfect, I've booked a moment at beginning of next week. Thank you! 😄

khalwat commented 3 months ago

Addressed in the above commits. You will need to re-save your Content SEO settings for each entry type.

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.75”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.46”,

Then do a composer clear-cache && composer update

…..

Craft CMS 5:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v5 as 5.0.0-beta.9”,

Then do a composer clear-cache && composer update

valboivin commented 2 months ago

It's hard for me to test. I've changed the plugin version to the one mentioned and followed your instructions and I still have my invisible link. I thought that I could try to disable and re-enable one of my pages entry type config, but I can't even access the sitemap menu of my entry type. It triggers an error.

screenshot 2024-04-08 at 10 19 54 AM

khalwat commented 2 months ago

Sorry, fixed that just now, do these instructions again to update to the latest:

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.75”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.46”,

Then do a composer clear-cache && composer update

…..

Craft CMS 5:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v5 as 5.0.0”,

Then do a composer clear-cache && composer update

khalwat commented 2 months ago

4.0.46 released -> https://github.com/nystudio107/craft-seomatic/releases/tag/4.0.46

valboivin commented 2 months ago

Sorry for the late reply, but it seems like my bug is still present. I've tried with Seomatic version 4.0.46 and also with the newest 4.0.48 version.

khalwat commented 2 months ago

Did you re-save the Content SEO settings for each entry type?

valboivin commented 2 months ago

Yes I did. It worked on my local environment, but not on our QA environment. It's odd. I'm thinking that it might be related to one specific entry and not a type in general. I'm not sure though.

jwrudzin commented 2 months ago

I'm still seeing this issue as well, even after updating to v4.0.48 and re-saving the Content SEO settings for each entry type (and clearing all caches).

khalwat commented 2 months ago

@jwrudzin Are you working on the same project as @valboivin ?

@valboivin Did you update the Content SEO settings on your QA environment for all entry types, as well as on your local environment?

valboivin commented 2 months ago

@khalwat, no we're not working on the same project. We don't even know each other.

And yes, I've updated the SEO settings for all entry types on my local environment, QA environment and even Staging environment.

khalwat commented 2 months ago

And yet it is fixed locally, whereas it did not work before?

I tested and verified the fix here, so I'm suspecting that it's something environmental. Are you able to inspect the seomatic_metabundles database table locally and on QA or staging, to see if the values for the typeId column for the sections/entry types in question are different?

They should be integer values, not strings.

jwrudzin commented 2 months ago

@khalwat For what it's worth I'm still seeing this issue both locally and on production. I resaved the content SEO settings and cleared all caches in both environments. Live non-working sitemap is here, in case it's helpful. I'll attach a screenshot of the database table you mentioned as well. Screenshot 2024-04-22 at 9 35 51 PM

khalwat commented 2 months ago

@jwrudzin that link doesn't work -- I think you provided the link to the local dev site

valboivin commented 2 months ago

Yes, the typeId values are integer values and they are exactly the same as the ones I have in local.

valboivin commented 2 months ago

@khalwat, I think I've found what is causing the bug! Actually, the only difference I've had between my local Seomatic config and the other environments is that one of my entry type had the Include Images & Videos in Sitemap toggled on while its Sitemap Enabled config was toggled off. I've disabled the images for that entry type and now I can see my link in the sitemap index!

screenshot 2024-04-23 at 10 13 10 AM
khalwat commented 2 months ago

That raises another point, you can't have Sitemap Enabled toggled off at the Content SEO settings, and then attempt to selectively turn it back on again at the SEO Settings field level.

It needs to work the other way around, where you keep Sitemap Enabled on for the Content SEO settings (because it is a higher level setting), and selectively disable it for some entries via the SEO Settings field. The Sitemap Enabled Content SEO setting is a higher-level setting that turns it off for that entire section.

khalwat commented 2 months ago

@valboivin That's pretty interesting. If you have time, I'd love to see the settings (either via screenshots here, or via a screen share again) that will allow me to replicate this locally.

https://savvycal.com/nystudio107/chat

jwrudzin commented 4 weeks ago

@khalwat I just launched another site that's running SEOmatic (v4.0.49), and am still running into this issue.

Here is the link to the non-working sitemap on production. I'm seeing the issue on my local and staging sites as well.

If there's any additional info I can provide to help troubleshoot, let me know!

khalwat commented 3 weeks ago

@jwrudzin Did you update the Content SEO settings for all entry types, as described above?

jwrudzin commented 3 weeks ago

@khalwat Interesting, toggling "Include Images & Videos in Sitemap" off and then back on seems to have fixed the issue. I think I'm all set. Thanks for the help!

khalwat commented 3 weeks ago

@jwrudzin right you need to resave the settings for that Content SEO section for the fix to work.