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

CMS 6: VersionFeed::getSiteRSSLink() should return link from home page. #91

Open
sabina-talipova opened this issue Oct 9, 2023 · 2 comments

Comments

@sabina-talipova
Copy link
Contributor

sabina-talipova commented Oct 9, 2023

Description

VersionFeed::getSiteRSSLink() should return link from home page, not from extension owner page.
See

public function getSiteRSSLink()
{
// TODO: This link should be from the homepage, not this page.
if (Config::inst()->get(get_class(), 'allchanges_enabled')
&& SiteConfig::current_site_config()->AllChangesEnabled
) {
return $this->owner->Link('allchanges');
}
}

@sabina-talipova sabina-talipova changed the title TODO: This link should be from the homepage, not this page TODO: VersionFeed::getSiteRSSLink() should return link from home page. Oct 10, 2023
@GuySartorelli
Copy link
Member

The change would likely look like this:

- return $this->owner->Link('allchanges');
+ $page = $this->owner;
+ if (!$page->isHomePage()) {
+     $page = SiteTree::get_by_link('/') ?? $page;
+ }
+ return $page->Link('allchanges');

This uses the extended page if it is the homepage, or if there isn't any homepage.

@GuySartorelli
Copy link
Member

Marking this as an API change since people will be relying on existing RSS links.

@GuySartorelli GuySartorelli changed the title TODO: VersionFeed::getSiteRSSLink() should return link from home page. CMS 6: VersionFeed::getSiteRSSLink() should return link from home page. Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants