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

Version feed is not compatible with silverstripe-fluent #55

Open
robbieaverill opened this issue May 29, 2018 · 0 comments
Open

Version feed is not compatible with silverstripe-fluent #55

robbieaverill opened this issue May 29, 2018 · 0 comments

Comments

@robbieaverill
Copy link
Contributor

Context: CWP 2.0.0, SilverStripe 4.1.1, Versionfeed 2.x-dev, Fluent 4.0.x-dev

Set up:

  • an English US locale
  • an English NZ locale
  • a page, published in both locales
  • a variety of context changes in each locale both saved as draft and published
  • changed_enabled config set to true

When viewing the version feed history for a page across locales, the changes returned are always from a single locale.

I notice that the logic in this module largely constructs raw SQL queries, which Fluent will not be able to modify - for example:

        // This can leak secured content if it was protected via inherited setting.
        // For now the users will need to be aware about this shortcoming.
        $offset = $highestVersion ? "AND \"SiteTree_Versions\".\"Version\"<='".(int)$highestVersion."'" : '';
        // Get just enough elements for diffing. We need one more than desired to have something to compare to.
        $qLimit = (int)$limit + 1;

        $versions = $this->owner->allVersions(
            "\"WasPublished\"='1' AND \"CanViewType\" IN ('Anyone', 'Inherit') $offset",
            "\"SiteTree\".\"LastEdited\" DESC, \"SiteTree\".\"ID\" DESC",
            $qLimit
        );

We need to rewrite the parts of raw SQL in this module to use the ORM so that other modules like Fluent can update queries as required.

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