-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Queue appears to create a job to generate sitemap when setting is disabled #1212
Comments
So I checked on this, it it does indeed check to ensure that sitemaps are enable before generating a sitemap: https://github.com/nystudio107/craft-seomatic/blob/develop/src/models/SitemapTemplate.php#L132 $sitemapUrls = $metaBundle->metaSitemapVars->sitemapUrls;
if (Seomatic::$plugin->sitemaps->anyEntryTypeHasSitemapUrls($metaBundle)) {
$robotsEnabled = true;
$sitemapUrls = true;
} ...but then it also checks to see if any of the Entry Types for that section have it enabled. Possible you have multiple entry types, but only disabled it for one of them? |
I'm unable to reproduce your issue here. If you have it reproducible in a local dev environment, we can try debugging it via screen share if you like? |
I was able to reproduce the issue locally. It doesn't appear to happen when an entry is created from the CP, only when a new entry is created by a lead filling out a form on the front end of the site. |
@khalwat any new thoughts on this? We are still seeing a pileup of queue jobs. Do you suppose this has something more to do with how the Element Connection works from the Solspace Freeform plugin works? |
This is probably due to the way that Solspace Freeform is saving the changes to the element. |
Hey @khalwat! |
So the this method in https://github.com/nystudio107/craft-seomatic/blob/develop/src/services/MetaBundles.php#L684 In looking at the code, I'm a little confused as to how it triggers anything, because the original bug says it's only for new entries coming from a frontend Solspace form, and the code checks for: // Is this a new source?
if (!$isNew) { And essentially does nothing if it's a new element. Perhaps the |
Thanks a lot for looking into it, I will investigate how to solve this problem on our end :) |
@khalwat Any ideas on how to combat this? |
This site setup does only have one site listed, but after seeing this I just double checked this site's database and found it has two site groups and the site is assigned to the second group. I am unsure as to why or how that came to be. I'm assuming it could fall under that issue of what @gustavs-gutmanis is talking about? |
@strandofgenius even if that's the case, it should still be taken care of somehow. Maybe we should not be propagating when saving? But I doubt it's possible, since propagation happens always on new elements. |
So perhaps a solution here is that I also check |
That might definitely help, could you try it out please?
|
@khalwat any update on this? |
So I implemented this, but I have a concern -- if I just don't invalidate MetaBundles when the element is propagating, I'm thinking there would be legit cases where it should be invalidating them. Consider if you save an element that propagates to other sites... in those cases, we do want the metabundles to be invalidated, and we do want the sitemaps to be regenerated. So I think that's the wrong approach. What I'm doing now is checking whether URLs are disabled for the section via Addressed in 04780df & 00d92b9 Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop as 3.4.49", Then do a ….. Craft CMS 4: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.20”, Then do a |
Thank you for your time on this. From what I've tested this resolves the queue jobs being generated if the sections are disabled. |
Describe the bug
Queue appears to be running a process to generate a sitemap when an entry type has public URLs but the sitemap setting is turned disabled in the SEOmatic content SEO settings.
The sitemap does not get added to
sitemap.xml
but it is going through a process to generate it.To reproduce
Steps to reproduce the behaviour:
Expected behaviour
It is expected that because the entry type sitemap setting is disabled it would not create a queue job to generate a sitemap.
Screenshots
Versions
The text was updated successfully, but these errors were encountered: