-
Notifications
You must be signed in to change notification settings - Fork 26
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
Related pages from CWP 1 (SS3) never publish in CWP2 (SS4) #221
Comments
Was able to fix this for our case with a migration task: class PublishAllRelatedPages extends BuildTask
{
protected $description = 'Migrates related pages from SS3 to SS4 by publishing all links.';
public function run($request)
{
$records = Versioned::get_by_stage(RelatedPageLink::class, Versioned::DRAFT);
echo "Updating {$records->count()} related page links... \n";
foreach ($records as $record) {
$record->writeToStage(Versioned::LIVE);
}
echo 'Done';
}
} |
This part sounds like a bug to me, since we have an |
@robbieaverill For sure it's a bug, but only for related pages on parent pages published prior to the "RelatedPagesThrough" patch. Vendors still need to come up woith a way of fixing "legacy" related pages, since ManyMany join tables didn't used to be Versioned (AFAIK) |
@matt-in-a-hat Legend. Your BuildTask worked, and les invasive than my solution which was to TRUNCATE (Live/Versions table equivalents) and re-populate from Draft. |
I ran into a similar issue with CMS 4 upgrades, where any object that wasn't previously versioned that has had Versioned applied to it (like related pages) will entirely disappear from the site due to the root table being used for draft (as opposed to the _Live suffix table for live content). I wrote a build task that has some in handy many times not just with CMS 4 upgrades through the years. This seems like too little too late, but it's still proving useful for me in 2023. https://gist.github.com/NightJar/eb0565d6d3ad41a5c5e6fcbfe6a54f4b It will publish any record that is versioned, but has no versions (_Versions suffix table). Versioned object have a version created when they are created - so the only way this happens is if Versioned is applied to pre-existing objects (previously "always live" in behaviour). The task uses singular publish and avoids |
If you have some pages that have related pages in SS3, once upgraded to SS4 those links do not show on live versions of the page, and there doesn't seem to be any way of publishing the links.
Since #177 we can add links and when the page is published the new links will show (e.g. with
<% loop RelatedPages %>
), but still the old related pages will not show on the front-end, even though they are showing in the gridfield in the CMS.And due to #179 we cannot remove these links and re-add them in hopes this will put them in the right state to be published.
Tested going from
cwp/cwp 1.9.1 270b719
To
cwp/cwp 2.3.1 ec6c13a
The text was updated successfully, but these errors were encountered: