http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692013-05-06T10:09:30ZTYPO3 ForgeTYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=1633062013-05-06T10:09:30ZThorsten Kahler
<ul><li><strong>Category</strong> set to <i>Frontend</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li><li><strong>Assignee</strong> set to <i>Eugene Skomorokhov</i></li></ul><p>Hi Eugene, I guess you meant line 73 in FilesContentObject.php, didn't you? Could you provide a little bit more elaborated example code, please?</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=1782622013-08-20T15:25:02ZAlexander Stehlik
<ul></ul><p>Hi,</p>
<p>I just stumbled over this issue today. I'm not sure if there are other usecases for this but thats the problem I've got:</p>
<p>I'm using the media field to upload images I want to display in a MENU object. Here is some example TypoScript:</p>
<pre>
page = PAGE
page.10 = HMENU
page.10 {
1 = TMENU
1 {
NO = 1
NO.wrapItemAndSub = <p>|</p>
NO.after.cObject = FILES
NO.after.cObject {
references.fieldName = media
renderObj = IMAGE
renderObj {
file.import.data = file:current:uid_local
file.width = 100
}
}
}
}
</pre>
<p>The problem as I understand it is indeed the line 77 in <code>\TYPO3\CMS\Frontend\ContentObject\FilesContentObject</code>. The field <code>_LOCALIZED_UID</code> is not available for pages.</p>
<p>The language overlay is done in two different methods in the <code>\TYPO3\CMS\Frontend\Page\PageRepository</code> class:</p>
<p><code>getPageOverlay()</code> - this is responsible for pages and sets the fields <code>_PAGES_OVERLAY</code>, <code>_PAGES_OVERLAY_UID</code> and <code>_PAGES_OVERLAY_LANGUAGE</code><br /><code>getRecordOverlay()</code> - this is responsible for other records and sets the field <code>_LOCALIZED_UID</code></p>
<p>I modified the code a bit and this seems to work:</p>
<pre><code class="php syntaxhl" data-language="php"><span class="nv">$localizedUid</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="n">cObj</span><span class="o">-></span><span class="n">data</span><span class="p">[</span><span class="s1">'_LOCALIZED_UID'</span><span class="p">];</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$table</span> <span class="o">===</span> <span class="s1">'pages'</span> <span class="o">&&</span> <span class="k">isset</span><span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="n">cObj</span><span class="o">-></span><span class="n">data</span><span class="p">[</span><span class="s1">'_PAGES_OVERLAY_UID'</span><span class="p">])</span> <span class="o">&&</span> <span class="nb">intval</span><span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="n">cObj</span><span class="o">-></span><span class="n">data</span><span class="p">[</span><span class="s1">'_PAGES_OVERLAY_LANGUAGE'</span><span class="p">])</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$table</span> <span class="o">=</span> <span class="s1">'pages_language_overlay'</span><span class="p">;</span>
<span class="nv">$localizedUid</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="n">cObj</span><span class="o">-></span><span class="n">data</span><span class="p">[</span><span class="s1">'_PAGES_OVERLAY_UID'</span><span class="p">];</span>
<span class="p">}</span>
<span class="nv">$referencesForeignTable</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="nf">stdWrapValue</span><span class="p">(</span><span class="s1">'table'</span><span class="p">,</span> <span class="nv">$conf</span><span class="p">[</span><span class="s1">'references.'</span><span class="p">],</span> <span class="nv">$table</span><span class="p">);</span>
<span class="nv">$referencesForeignUid</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="nf">stdWrapValue</span><span class="p">(</span><span class="s1">'uid'</span><span class="p">,</span> <span class="nv">$conf</span><span class="p">[</span><span class="s1">'references.'</span><span class="p">],</span> <span class="k">isset</span><span class="p">(</span><span class="nv">$localizedUid</span><span class="p">)</span> <span class="o">?</span> <span class="nv">$localizedUid</span> <span class="o">:</span> <span class="nv">$this</span><span class="o">-></span><span class="n">cObj</span><span class="o">-></span><span class="n">data</span><span class="p">[</span><span class="s1">'uid'</span><span class="p">]);</span>
</code></pre>
<p>If you think this makes sense I'll upload a patch to gerrit.</p>
<p>Cheers,<br />Alex</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=1783872013-08-21T13:27:44ZAlexander Opitzopitz.alexander@googlemail.com
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>New</i></li></ul><p>@Alexander Stehlik</p>
<p>I don't know if it make sense, but providing a patch to gerrit is always usefull.</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=1784102013-08-21T15:33:19ZPhilipp Gampephilipp.gampe@typo3.org
<ul></ul><p>It might be a good idea to ping Helmut, as he seemed to have something with l10n in mind for FAL.</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=1873702013-10-18T00:18:47ZGerrit Code Review
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Under Review</i></li></ul><p>Patch set 1 for branch <strong>master</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/24884">https://review.typo3.org/24884</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=1873722013-10-18T00:41:37ZAlexander Stehlik
<ul></ul><p>Sorry, I totally lost track of this one. A patch was submitted to gerrit.</p>
<a name="Test-environment"></a>
<h3 >Test environment<a href="#Test-environment" class="wiki-anchor">¶</a></h3>
<p>To set up a simple test environment for reproducing the error follow these steps</p>
<ul>
<li>in the TYPO3 root create a sys_language record</li>
<li>create a new root page</li>
<li>create a TypoScript template in that root page and fill the setup section with the value documented below</li>
<li>adjust the <code>config.sys_language_uid</code> valid to your environment</li>
<li>create a translation for the root page</li>
<li>create a subpage</li>
<li>set an image in the media section of the subpage</li>
<li>create a translation for the subpage</li>
<li>set an image (a different one!) in media section the translation of the subpage</li>
<li>open the root page in the Frontend and switch the language (append &L=1)</li>
</ul>
<a name="TypoScript-template-setup"></a>
<h3 >TypoScript template setup<a href="#TypoScript-template-setup" class="wiki-anchor">¶</a></h3>
<pre>
page = PAGE
page.10 = HMENU
page.10 {
1 = TMENU
1 {
NO = 1
NO.wrapItemAndSub = <p>|</p>
NO.after.cObject = FILES
NO.after.cObject {
references.fieldName = media
renderObj = IMAGE
renderObj {
file.import.data = file:current:uid_local
file.width = 100
}
}
}
}
config.sys_language_uid = 0
[globalVar = GP:L = 1]
config.sys_language_uid = 1
[global]
</pre>
<a name="Expected-results"></a>
<h3 >Expected results<a href="#Expected-results" class="wiki-anchor">¶</a></h3>
<p>The expected result is to see the translated page title of the subpage and the image that was set in the media section of the <strong>translation</strong> record.</p>
<p>Before the patch is applied the image that was set in the <strong>page</strong> media section will be displayed.</p>
<p>After the patch the expected image set in the page <strong>translation</strong> media section is displayed.</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2094722014-03-21T12:22:57ZGerrit Code Review
<ul></ul><p>Patch set 2 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/24884">https://review.typo3.org/24884</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2124592014-04-09T13:42:33ZGerrit Code Review
<ul></ul><p>Patch set 4 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/24884">https://review.typo3.org/24884</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2141972014-04-25T18:36:13ZGianpaolo Scrignaletsjump@gmail.com
<ul></ul><p>I can confirm the bug. Your patch works perfectly on Typo3 6.1.8<br />Thanks</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2154692014-05-04T15:51:44ZGerrit Code Review
<ul></ul><p>Patch set 6 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/29739">https://review.typo3.org/29739</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2160192014-05-08T14:35:16ZGerrit Code Review
<ul></ul><p>Patch set 7 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/29739">https://review.typo3.org/29739</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2164222014-05-12T11:17:47ZGerrit Code Review
<ul></ul><p>Patch set 5 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/24884">https://review.typo3.org/24884</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2199842014-06-11T16:54:39ZGerrit Code Review
<ul></ul><p>Patch set 8 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/29739">https://review.typo3.org/29739</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2199972014-06-11T17:17:38ZSteffen Ritterinfo@rs-websystems.de
<ul><li><strong>Status</strong> changed from <i>Under Review</i> to <i>Resolved</i></li><li><strong>Is Regression</strong> set to <i>No</i></li></ul> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2200082014-06-11T17:50:27ZGerrit Code Review
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Under Review</i></li></ul><p>Patch set 1 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/30666">https://review.typo3.org/30666</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2200172014-06-11T19:49:09ZGerrit Code Review
<ul></ul><p>Patch set 2 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/30666">https://review.typo3.org/30666</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2200382014-06-11T22:39:38ZGerrit Code Review
<ul></ul><p>Patch set 3 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/30666">https://review.typo3.org/30666</a></p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=2200492014-06-11T23:30:30ZSteffen Ritterinfo@rs-websystems.de
<ul><li><strong>Status</strong> changed from <i>Under Review</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="[BUGFIX] FollowUp to "Invalid localization overlay of cObject FILES" When fixing language overla..." href="http://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/90b0b4a3973697c2324c5a7ef8eec7db0a23d66e">90b0b4a3973697c2324c5a7ef8eec7db0a23d66e</a>.</p> TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pageshttp://forge.typo3.org/issues/47869?journal_id=3841312018-10-02T12:14:01ZBenni Mackbenni@typo3.org
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>