<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Silverstripe &#8211; has_many- and many_many-relations when duplicating pages	</title>
	<atom:link href="https://nerdpress.org/2012/03/07/silverstripe-has-many-and-many-many-relations-when-duplicating-pages/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org/2012/03/07/silverstripe-has-many-and-many-many-relations-when-duplicating-pages/</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Sun, 03 Jun 2012 08:46:21 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Thomas B. Nielsen		</title>
		<link>https://nerdpress.org/2012/03/07/silverstripe-has-many-and-many-many-relations-when-duplicating-pages/#comment-17813</link>

		<dc:creator><![CDATA[Thomas B. Nielsen]]></dc:creator>
		<pubDate>Sun, 03 Jun 2012 08:46:21 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=2087#comment-17813</guid>

					<description><![CDATA[Hi Max,

Just came across this post, i&#039;m the one who asked the question on the forum, that you were so kind to answer.

I still use this code, it&#039;s very handy. Maybe someone could write this into a module? But perhaps it will not be needed in SS3.

Just found this kinda related info, which is about copying relations when creating translations - the post is here:
http://www.silverstripe.org/general-questions/show/19990

The code (you might want to add this to your post):
Added the following code at the end of the function createTranslation($locale) in Translatable.php
[php]
foreach( $originalPage-&#038;gt;many_many() as $key =&#062; $className ){
$newTranslation-&#062;{$key}()-&#062;addMany($originalPage-&#062;{$key}()-&#062;getIdList());
}
[/php]
Regards,
Thomas - Nobrainer Web]]></description>
			<content:encoded><![CDATA[<p>Hi Max,</p>
<p>Just came across this post, i&#8217;m the one who asked the question on the forum, that you were so kind to answer.</p>
<p>I still use this code, it&#8217;s very handy. Maybe someone could write this into a module? But perhaps it will not be needed in SS3.</p>
<p>Just found this kinda related info, which is about copying relations when creating translations &#8211; the post is here:<br />
<a href="http://www.silverstripe.org/general-questions/show/19990" rel="nofollow ugc">http://www.silverstripe.org/general-questions/show/19990</a></p>
<p>The code (you might want to add this to your post):<br />
Added the following code at the end of the function createTranslation($locale) in Translatable.php</p>
<pre class="brush: php; title: ; notranslate">
foreach( $originalPage-&amp;gt;many_many() as $key =&gt; $className ){
$newTranslation-&gt;{$key}()-&gt;addMany($originalPage-&gt;{$key}()-&gt;getIdList());
}
</pre>
<p>Regards,<br />
Thomas &#8211; Nobrainer Web</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
