-
Notifications
You must be signed in to change notification settings - Fork 57
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
All links in cached page appended with ?stage=Live in SS3.7.3 #102
Comments
+1 also having this issue |
In the file
Applying this patch seems to resolve the issue for me but doesn't really touch on why the stage is in the URL in the first place. |
This is probably a hang over from the alteration to not store global state between requests - it was causing confusion with editors viewing draft content without realising, as there was no indication. Remember the old days when ?Stage=draft would set a session var, then every request regardless of GET param would always be draft? This might be caused by the job being queued from within the CMS, or is a hangover from ensuring that the live site is cached. This is all out loud thoughts, in case anyone wants to take a look and maybe submit a PR for HacktoberFest ;) I say this because even though the module is marked as supported, this is the SilverStripe 3 compatible version - which is in security support only. |
Related #100 |
If anyone is still having an issue with this, I had to implement a hacky fix on an old site we needed to statically generate due to some unexpectedly high traffic to it. In FilesystemPublisher.php, around line 305, I added some code to strip out ?stage=Live in the to-be-saved .html cached file after the if-statment: "if (Config::inst()->get('FilesystemPublisher', 'include_caching_metadata')) {":
|
I'm not sure if this is fixed, but I'm afraid v3 is out of support now |
Any links in pages generated through the Sitetree Link() function are being appended with "?stage=Live" in the cached files. This is an issue for SEO reasons, as the same content is being served on two urls.
For example, when looping through dataobjects in a template:
This would result in a URL like: /apartmtent_title?stage=Live being output.
I have tried overriding the Link function in Page.php:
However this results in staged content being included in the cache in loops such as above.
Has anybody come across this issue or a solution for it?
The text was updated successfully, but these errors were encountered: