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

[Documentation request] Make Subsite Filtering more explicit in README #456

Open
davejtoews opened this issue Jul 28, 2020 · 1 comment
Open

Comments

@davejtoews
Copy link

davejtoews commented Jul 28, 2020

I was having some really weird behaviour in trying to put together a BuildTask that populates some required pages and migrates some page classes for a change I'm making to an existing website. It turns out there were two things causing me trouble.

  1. My get() calls to check for existing pages were behaving differently depending on the last Subsite I accessed in the CMS.
  2. My create() calls were creating pages in different places depending on the last Subsite I accessed in the CMS.

The solution was to add Subsite::changeSubsite(0); and Subsite::disable_subsite_filter(); to the top of my run() method in the build task.

It took trial and error and reading through code and Issues to find the solution, but I think this behaviour and the disable method could be called out in the docs to prevent this kind of frustration.

If and when I get the time I may submit a PR on the README myself, but it might be better from someone more familiar with the particulars of this module.

@Cheddam
Copy link
Member

Cheddam commented Jul 30, 2020

Hey Dave, the Subsite::disable_subsite_filter() / Subsite::disable_subsite_filter() methods are a pretty important escape hatch for projects using Subsites, so I agree that the docs should cover their use. We'd happily accept a PR for this :)

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