TYPO3 Forge: Issueshttp://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692020-03-03T13:10:05ZTYPO3 Forge
Redmine TYPO3 Core - Bug #90624 (Closed): Backend SiteResolver middleware is not able to resolve site whe...http://forge.typo3.org/issues/906242020-03-03T13:10:05ZMarkus Mächleradmin@bithost.ch
<p>When editing a record, the backend SiteResolver is not able to determine the current site because the <strong>id</strong> parameter is not set. This is for instance needed if you have a user function display condition where you want to show a field depending on a site configuration.</p> TYPO3 Core - Bug #90600 (New): Frontend cache inconsistency with processed imageshttp://forge.typo3.org/issues/906002020-02-29T12:40:04ZMarkus Mächleradmin@bithost.ch
<p>We discovered a cache inconsistency where processed images can be removed from the filesystem, even though they are still part of a cached page. We have tested this with TYPO3 9 LTS, but it is very likely also an issue with TYPO3 10 LTS.</p>
<p><strong>Steps to reproduce the issue</strong></p>
<ol>
<li>Create two pages <em>pageA</em> and <em>pageB</em></li>
<li>Add an images content element to <em>pageA</em> and <em>pageB</em> and choose the same image <em>demo_image.png</em></li>
<li>Apply image processing to the image (e.g. max width 50px) on both pages</li>
<li>Open both pages in the frontend and note the generated unique hash (e.g. /fileadmin/_processed_/d/2/csm_demo_2cb965e686.png -> <strong>2cb965e686</strong>). The hash should be the same on both pages.</li>
<li>Change the column <strong>modification_date</strong> in <strong>sys_file</strong> for <em>demo_image.png</em>, this will lead to a new hash for the processed image</li>
<li>Clear the page cache for <em>pageA</em> only</li>
<li>Open <em>pageA</em> in the frontend, note the new unique hash e.g. /fileadmin/_processed_/d/2/csm_demo_bf52a6057a.png -> <strong>bf52a6057a</strong>)</li>
<li>Note that the previous processed image <strong>csm_demo_2cb965e686.png</strong> has been removed from the file system</li>
<li>Open <em>pageB</em> (make sure caching is not disabled, e.g. use inkognito mode) and note that the image is missing on the page because it is still referencing <strong>csm_demo_2cb965e686.png</strong>, which has been deleted.</li>
</ol>
<p><strong>Proposed fix</strong></p>
<p>Add page cache tags for all processed images. Whenever a processed image is removed, clear the page cache of all pages including that image using the cache tags.</p>
<p><strong>Additional info</strong></p>
<p>At the moment the deletion is done in <strong>TYPO3\CMS\Core\Resource\ProcessedFile</strong> in a function called <strong>needsReprocessing</strong>. Probably processed images should not be deleted in a seemingly innocent method called <strong>needsReprocessing</strong>. See <a class="external" href="https://github.com/TYPO3/TYPO3.CMS/blob/9bb994f492e75efcfe139c3d6a64ef42dbef9bd1/typo3/sysext/core/Classes/Resource/ProcessedFile.php#L513-L515">https://github.com/TYPO3/TYPO3.CMS/blob/9bb994f492e75efcfe139c3d6a64ef42dbef9bd1/typo3/sysext/core/Classes/Resource/ProcessedFile.php#L513-L515</a></p> TYPO3 Core - Bug #87190 (New): Can not use groupBy in ContentObjectRenderer with MySQL strict modehttp://forge.typo3.org/issues/871902018-12-17T16:47:53ZMarkus Mächleradmin@bithost.ch
<p>Currently it is not possible to use <code>GROUP BY</code> with the <code>ContentObjectRenderer</code> when using MySQL in strict mode (as it is by default with <code>MySQL 5.7</code>). The problem is that the method <code>sanitizeSelectPart</code> adds <code>uid</code>,<code>pid</code> and <code>t3ver_state</code> fields that MySQL does not know how to aggregate.</p>
<p><strong>How to reproduce</strong></p>
<p>Create a new page with a new template record and the following TypoScript setup:</p>
<pre>
page = PAGE
page.10 = CONTENT
page.10 {
table = tt_content
select {
selectFields = YEAR(FROM_UNIXTIME(crdate)) AS years
groupBy = years
}
renderObj = COA
renderObj {
10 = TEXT
10.field = years
10.wrap = year:&nbsp;|<br>
}
}
</pre>
<p><strong>Error message</strong></p>
<pre>
An exception occurred while executing
'SELECT YEAR(FROM_UNIXTIME(crdate)) AS years, `tt_content`.`uid` AS `uid`, `tt_content`.`pid` AS `pid`, `tt_content`.`t3ver_state` AS `t3ver_state` FROM `tt_content`
WHERE [..]
GROUP BY `years` ORDER BY `years` DESC':
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'typo3_9.tt_content.uid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
</pre>
<p><strong>Workaround</strong></p>
<p>A workaround is to add <code>COUNT(*)</code> to the <code>selectFields</code> list as this prevents TYPO3 from adding the additional fields.</p>
<pre>
page.10.select.selectFields = YEAR(FROM_UNIXTIME(crdate)) AS years, COUNT(*)
</pre>
<p><strong>Possible solution</strong></p>
<p>Maybe it would be possible to not use <code>sanitizeSelectPart</code> if there is a <code>groupBy</code> option set.</p> TYPO3 Core - Feature #86295 (New): Add a TYPO3 JavaScript frontend APIhttp://forge.typo3.org/issues/862952018-09-18T13:51:08ZMarkus Mächleradmin@bithost.ch
<p>As a developer there is very little to no support when writing JavaScript code in the frontend. Every time a value from the server is needed in the frontend, the code to glue them together has to be written manually by passing the value to a Fluid template or render a script tag using TypoScript.</p>
<p>It would be awesome if TYPO3 would offer a JavaScript API that offers some basic functionality. This is of growing importance as frontends are becoming more and more complex. This could be a unique feature that sets TYPO3 apart from so many other CMS.</p>
<p>I think the JavaScript API should be independent of any third party framework. Some useful features that come to my mind would be:</p>
<p>- Information about the current page (pid, layout, etc.)<br />- A utility function to get labels from language files (probably the labels that are available in the frontend have to be configured explicitly)<br />- Possibility to log frontend JavaScript errors to the backend<br />- Probably many more ...</p>
<p>I know that this is a very big task and it is not easy to decide what should be implemented and how, but I think it is worth to at least consider it.</p> TYPO3 Core - Bug #84142 (Closed): Forms interfering when using the same form multiple times on on...http://forge.typo3.org/issues/841422018-03-05T16:05:28ZMarkus Mächleradmin@bithost.ch
<p>It is currently not possible to use the same form multiple times on a single page without interference of the forms. How to reproduce:</p>
<p>1. Create a form with two pages<br />2. Create two form plugins on the same page and choose form from step 1 for both plugins<br />3. Navigate to the second page of the first form<br />4. Result: both forms are no on page 2</p>
<p>There are more issues with this:<br />- Values entered in one form are also present in the second form<br />- Finisher emails are sent two times</p>
<p>The problem is that forms are not treated uniquely by plugin integration, but just by form definition. E.g. form field names just use the form name as prefix: tx_form_formframework[form_name][field_name]</p>
<p>In my opinion it should be possible to use the same form multiple times on the same page but with different finishers set on the corresponding plugin content element. A common use case for instance is a contact form that has different recipients depending on the issue.</p> TYPO3 Core - Feature #83353 (Closed): Add extbase db operand for using ExtractValue() in queries,...http://forge.typo3.org/issues/833532017-12-16T12:49:17ZMarkus Mächleradmin@bithost.ch
<p>I suggest to add a new operand that allows using the MySQL ExtractValue() function that allows retrieving a value specified by an xpath of the xml-content .<br />See <a class="external" href="https://dev.mysql.com/doc/refman/5.6/en/xml-functions.html#function_extractvalue">https://dev.mysql.com/doc/refman/5.6/en/xml-functions.html#function_extractvalue</a></p>
<p>This can be particularly useful when working with flexform data, e.g. also when creating content elements with gridelements.</p>
<p>Example usage e.g. in <code>SampleRepository.php</code>:</p>
<pre><code class="php syntaxhl" data-language="php">
<span class="kn">namespace</span> <span class="nn">BKW\BkwTiles\Domain\Repository</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">VND\MyExtension\Domain\Db\ExtractValue</span><span class="p">;</span>
<span class="kd">class</span> <span class="nc">SampleRepository</span> <span class="kd">extends</span> <span class="nc">\TYPO3\CMS\Extbase\Persistence\Repository</span> <span class="p">{</span>
<span class="cd">/**
* Returns all something elements on a page, filtered by title
* @param string $someTitle title to filter for
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">findFiltered</span><span class="p">(</span><span class="nv">$someTitle</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$query</span><span class="o">-></span><span class="nf">logicalAnd</span><span class="p">([</span>
<span class="nv">$query</span><span class="o">-></span><span class="nf">equals</span><span class="p">(</span><span class="s1">'ctype'</span><span class="p">,</span> <span class="s1">'something'</span><span class="p">),</span>
<span class="nv">$query</span><span class="o">-></span><span class="nf">equalsExtractValue</span><span class="p">(</span><span class="s1">'//data/sheet[@index="text"]/language[1]/field[@index="title"]/value'</span><span class="p">,</span> <span class="s1">'pi_flexform'</span><span class="p">,</span> <span class="nv">$someTitle</span><span class="p">)</span>
<span class="p">]);</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>So far, we implemented this by extending the <code>Typo3DbQueryParser</code> with the following code:</p>
<pre><code class="php syntaxhl" data-language="php"><span class="cp"><?php</span>
<span class="kn">namespace</span> <span class="nn">VND\MyExtension\Xclass\Db</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">VND\MyExtension\Domain\Db\ExtractValueInterface</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface</span><span class="p">;</span>
<span class="kd">class</span> <span class="nc">Typo3DbQueryParser</span> <span class="kd">extends</span> <span class="nc">\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser</span> <span class="p">{</span>
<span class="cd">/**
* @param DynamicOperandInterface $operand
* @param SourceInterface $source The source
* @param array &$sql The query parts
* @return string
* @throws \InvalidArgumentException
*/</span>
<span class="k">protected</span> <span class="k">function</span> <span class="n">parseOperand</span><span class="p">(</span><span class="kt">DynamicOperandInterface</span> <span class="nv">$operand</span><span class="p">,</span> <span class="kt">SourceInterface</span> <span class="nv">$source</span><span class="p">,</span> <span class="kt">array</span> <span class="o">&</span><span class="nv">$sql</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$operand</span> <span class="k">instanceof</span> <span class="nc">ExtractValueInterface</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$source</span> <span class="k">instanceof</span> <span class="nc">SelectorInterface</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// @todo Only necessary to differ from Join</span>
<span class="nv">$className</span> <span class="o">=</span> <span class="nv">$source</span><span class="o">-></span><span class="nf">getNodeTypeName</span><span class="p">();</span>
<span class="nv">$tableName</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="n">dataMapper</span><span class="o">-></span><span class="nf">convertClassNameToTableName</span><span class="p">(</span><span class="nv">$className</span><span class="p">);</span>
<span class="p">}</span> <span class="k">elseif</span> <span class="p">(</span><span class="nv">$source</span> <span class="k">instanceof</span> <span class="nc">JoinInterface</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$tableName</span> <span class="o">=</span> <span class="nv">$source</span><span class="o">-></span><span class="nf">getJoinCondition</span><span class="p">()</span><span class="o">-></span><span class="nf">getSelector1Name</span><span class="p">();</span>
<span class="p">}</span>
<span class="nv">$constraintSQL</span> <span class="o">=</span> <span class="s1">'ExtractValue('</span> <span class="mf">.</span> <span class="k">parent</span><span class="o">::</span><span class="nf">parseOperand</span><span class="p">(</span><span class="nv">$operand</span><span class="p">,</span> <span class="nv">$source</span><span class="p">,</span> <span class="nv">$sql</span><span class="p">)</span> <span class="mf">.</span> <span class="s1">', '</span><span class="mf">.</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">databaseHandle</span><span class="o">-></span><span class="nf">fullQuoteStr</span><span class="p">(</span><span class="nv">$operand</span><span class="o">-></span><span class="nf">getXpath</span><span class="p">(),</span> <span class="k">isset</span><span class="p">(</span><span class="nv">$tableName</span><span class="p">)</span> <span class="o">?</span> <span class="nv">$tableName</span> <span class="o">:</span> <span class="s1">''</span><span class="p">)</span><span class="mf">.</span><span class="s1">')'</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">parent</span><span class="o">::</span><span class="nf">parseOperand</span><span class="p">(</span><span class="nv">$operand</span><span class="p">,</span> <span class="nv">$source</span><span class="p">,</span> <span class="nv">$sql</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nv">$constraintSQL</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>where the line containing the <code>ExtractValue()</code> part is new, the rest is copied from the original <code>Typo3DbQueryParser</code></p>
<p>a new operand <code>ExtractValue</code> extending the existing <code>PropertyValue</code> is defined as follows:<br /><code>ExtractValueInterface.php</code><br /><pre><code class="php syntaxhl" data-language="php"><span class="cp"><?php</span>
<span class="kn">namespace</span> <span class="nn">VND\MyExtension\Domain\Db</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValueInterface</span><span class="p">;</span>
<span class="kd">interface</span> <span class="nc">ExtractValueInterface</span> <span class="kd">extends</span> <span class="nc">PropertyValueInterface</span> <span class="p">{</span>
<span class="cd">/**
* Gets the xpath
*
* @return string the property name; non-null
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">getXpath</span><span class="p">();</span>
<span class="p">}</span>
</code></pre></p>
<code>ExtractValue.php</code><br /><pre><code class="php syntaxhl" data-language="php"><span class="cp"><?php</span>
<span class="kn">namespace</span> <span class="nn">VND\MyExtension\Domain\Db</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValue</span><span class="p">;</span>
<span class="kd">class</span> <span class="nc">ExtractValue</span> <span class="kd">extends</span> <span class="nc">PropertyValue</span> <span class="kd">implements</span> <span class="nc">ExtractValueInterface</span> <span class="p">{</span>
<span class="cd">/**
* @var string
*/</span>
<span class="k">protected</span> <span class="nv">$xpath</span><span class="p">;</span>
<span class="cd">/**
* Constructs this ExtractValue instance
*
* @param string $propertyName
* @param string $selectorName
* @param string $xpath
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">__construct</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$selectorName</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">parent</span><span class="o">::</span><span class="nf">__construct</span><span class="p">(</span><span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$selectorName</span><span class="p">);</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">xpath</span> <span class="o">=</span> <span class="nv">$xpath</span><span class="p">;</span>
<span class="p">}</span>
<span class="cd">/**
* Gets the xpath
*
* @return string xpath; non-null
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">getXpath</span><span class="p">()</span>
<span class="p">{</span>
<span class="k">return</span> <span class="nv">$this</span><span class="o">-></span><span class="n">xpath</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>and in <code>Query.php</code> you would have something like</p>
<pre><code class="php syntaxhl" data-language="php"><span class="cp"><?php</span>
<span class="kn">namespace</span> <span class="nn">VND\MyExtension\Xclass\Db</span><span class="p">;</span>
<span class="cd">/**
* The Query class used to run queries against the database
*
* @api
*/</span>
<span class="kd">class</span> <span class="nc">Query</span> <span class="kd">extends</span> <span class="nc">\TYPO3\CMS\Extbase\Persistence\Generic\Query</span> <span class="p">{</span>
<span class="cd">/**
* Returns an equals criterion used for matching objects against a query
*
* @param string $xpath xpath to query for
* @param string $propertyName The name of the property to compare against
* @param mixed $operand The value to compare with
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
* @api
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">equalsExtractValue</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$operand</span><span class="p">)</span>
<span class="p">{</span>
<span class="nv">$comparison</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="n">qomFactory</span><span class="o">-></span><span class="nf">comparison</span><span class="p">(</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">qomFactory</span><span class="o">-></span><span class="nf">extractValue</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$this</span><span class="o">-></span><span class="nf">getSelectorName</span><span class="p">()),</span>
<span class="nc">QueryInterface</span><span class="o">::</span><span class="no">OPERATOR_EQUAL_TO</span><span class="p">,</span>
<span class="nv">$operand</span>
<span class="p">);</span>
<span class="k">return</span> <span class="nv">$comparison</span><span class="p">;</span>
<span class="p">}</span>
</code></pre>
<p>and finally in the <code>QueryObjectModelFactory.php</code> you have</p>
<pre><code class="php syntaxhl" data-language="php"><span class="kn">namespace</span> <span class="nn">VND\MyExtension\Xclass\Db</span><span class="p">;</span>
<span class="kd">class</span> <span class="nc">QueryObjectModelFactory</span> <span class="kd">extends</span> <span class="nc">\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory</span> <span class="p">{</span>
<span class="cd">/**
* Evaluates to the value (or values, if multi-valued) of a property in the specified or default selector.
*
* @param string $xpath xpath
* @param string $propertyName the property name; non-null
* @param string $selectorName the selector name; non-null
* @return \VND\MyExtension\Domain\Db\ExtractValueInterface the operand; non-null
* @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">extractValue</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$selectorName</span> <span class="o">=</span> <span class="s1">''</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">return</span> <span class="nv">$this</span><span class="o">-></span><span class="n">objectManager</span><span class="o">-></span><span class="nf">get</span><span class="p">(</span><span class="nc">\VND\MyExtension\Domain\Db\ExtractValue</span><span class="o">::</span><span class="n">class</span><span class="p">,</span> <span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$selectorName</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>Note for developers that want to use this feature in TYPO3 7 or 8:<br />If you don't want to xclass the <code>QueryObjectModelFactory</code> or <code>Query</code> classes, you can also just xclass the <code>Typo3DbQueryParser</code> as explained above and use the <code>ExtractValue</code> object in your repository directly:</p>
<pre><code class="php syntaxhl" data-language="php">
<span class="kn">namespace</span> <span class="nn">BKW\BkwTiles\Domain\Repository</span><span class="p">;</span>
<span class="kn">use</span> <span class="nc">VND\MyExtension\Domain\Db\ExtractValue</span><span class="p">;</span>
<span class="kd">class</span> <span class="nc">SampleRepository</span> <span class="kd">extends</span> <span class="nc">\TYPO3\CMS\Extbase\Persistence\Repository</span> <span class="p">{</span>
<span class="cd">/**
* @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory
*/</span>
<span class="k">protected</span> <span class="nv">$qomFactory</span><span class="p">;</span>
<span class="cd">/**
* @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">injectQomFactory</span><span class="p">(</span><span class="nc">\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory</span> <span class="nv">$qomFactory</span><span class="p">)</span>
<span class="p">{</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">qomFactory</span> <span class="o">=</span> <span class="nv">$qomFactory</span><span class="p">;</span>
<span class="p">}</span>
<span class="cd">/**
* Evaluates to the xpath of an xml-value (or values, if multi-valued) of a property in the specified or default selector.
*
* @param string $propertyName the property name; non-null
* @param string $selectorName the selector name; non-null
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValueInterface the operand; non-null
* @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">extractValue</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$selectorName</span> <span class="o">=</span> <span class="s1">''</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">return</span> <span class="nv">$this</span><span class="o">-></span><span class="n">objectManager</span><span class="o">-></span><span class="nf">get</span><span class="p">(</span><span class="nc">ExtractValue</span><span class="o">::</span><span class="n">class</span><span class="p">,</span> <span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$selectorName</span><span class="p">);</span>
<span class="p">}</span>
<span class="cd">/**
* Returns an equals criterion used for matching objects against a query
*
* @param string $xpath xpath to query for
* @param string $propertyName The name of the property to compare against
* @param mixed $operand The value to compare with
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
* @api
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">equalsExtractValue</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$operand</span><span class="p">)</span>
<span class="p">{</span>
<span class="nv">$comparison</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="n">qomFactory</span><span class="o">-></span><span class="nf">comparison</span><span class="p">(</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">qomFactory</span><span class="o">-></span><span class="nf">extractValue</span><span class="p">(</span><span class="nv">$xpath</span><span class="p">,</span> <span class="nv">$propertyName</span><span class="p">,</span> <span class="nv">$this</span><span class="o">-></span><span class="nf">getSelectorName</span><span class="p">()),</span>
<span class="nc">QueryInterface</span><span class="o">::</span><span class="no">OPERATOR_EQUAL_TO</span><span class="p">,</span>
<span class="nv">$operand</span>
<span class="p">);</span>
<span class="k">return</span> <span class="nv">$comparison</span><span class="p">;</span>
<span class="p">}</span>
<span class="cd">/**
* Returns all something elements on a page, filtered by title
* @param string $someTitle title to filter for
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">findFiltered</span><span class="p">(</span><span class="nv">$someTitle</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$query</span><span class="o">-></span><span class="nf">logicalAnd</span><span class="p">([</span>
<span class="nv">$query</span><span class="o">-></span><span class="nf">equals</span><span class="p">(</span><span class="s1">'ctype'</span><span class="p">,</span> <span class="s1">'something'</span><span class="p">),</span>
<span class="nv">$this</span><span class="o">-></span><span class="nf">equalsExtractValue</span><span class="p">(</span><span class="s1">'//data/sheet[@index="text"]/language[1]/field[@index="title"]/value'</span><span class="p">,</span> <span class="s1">'pi_flexform'</span><span class="p">,</span> <span class="nv">$someTitle</span><span class="p">)</span>
<span class="p">]);</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>So, what do you guy think about this feature / approach? It would be nice to see this in the TYPO3 extbase core. It helps handling flexforms a lot and encourages people to use extbase for database abstraction and handling content elements.</p> TYPO3 Core - Bug #78844 (Closed): HTML5: use self-closing tags only if allowedhttp://forge.typo3.org/issues/788442016-11-30T15:50:55ZMarkus Mächleradmin@bithost.ch
<p>In the frontend rendering of RTE content, empty tags should only be converted to self-closing tags if allowed by the HTML5 standard.<br />The Problem ist that e.g. </p>
<pre><code>&lt;a id=&quot;myspecialanchor&quot;&gt;&lt;/a&gt;</code></pre>
<p>is converted to</p>
<pre><code>&lt;a id=&quot;myspecialanchor&quot; /&gt;</code></pre>
<p>which will result in the subsequent content being rendered as a link, too (at least in Google Chrome).</p>
<p>This Problem exists in TYPO3 7.6 and 8.</p>
<p>This is because only specific tags may be self-closing according to the HTML5 specification:</p>
<p><a class="external" href="https://www.w3.org/TR/html5/syntax.html#void-elements">https://www.w3.org/TR/html5/syntax.html#void-elements</a></p>
<p>Void elements: area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr</p>
<p>The following line should be fixed:</p>
<p><a class="external" href="https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L4964">https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L4964</a></p>
<p>Moreover, the a notice should be added to the todo-comment in following line</p>
<p><a class="external" href="https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L4074">https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L4074</a></p> TYPO3 Core - Bug #78599 (Closed): Copy localized content element leads to wrong reference, transl...http://forge.typo3.org/issues/785992016-11-07T18:22:19ZMarkus Mächleradmin@bithost.ch
<p>the following steps:</p>
<p>- create a new page "P.A" <br />- create a new content element "CE.A" on page "P.A" <br />- localize "CE.A" to "CE.A en" <br />- create a new page "P.B" <br />- add a new content element "CE.B" on page "P.B" <br />- copy "CE.A" to page "P.B" to "CE.A copy". this automatically copies "CE.A en" to "CE.A en copy".</p>
<p>the copied, translated element "CE.A en copy" does have a correct l18n_parent "CE.A copy" set, however, the t3_origuid points to "CE.A en", instead of "CE.A copy".</p>
<p>if you now hit the "translate" button on page "P.B", it results in "A en copy" being translated by the localization wizard over and over, leading to many copies of "A en copy" instead of translating "CE.B"</p>
<p>this was tested with TYPO3 7.6.12,7.6.13-dev without any extensions installed.</p> TYPO3 Core - Bug #78050 (Closed): Translation of inline records not working correctly with catego...http://forge.typo3.org/issues/780502016-09-23T14:37:02ZMarkus Mächleradmin@bithost.ch
<p>There is an issue when using inline records with categories on translated records. If both the parent record and the inline record have categories I get a JavaScript error when I want to use "Localize all records" and the inline record does not update. If I reload the page then the record is translated correctly.</p>
<p>The easiest way to reproduce the issue is to use a fresh TYPO3 7.6 installation and install the news extension. (However it is reproducible with any element that has inline records)</p>
<ol>
<li>Install TYPO3 7.6</li>
<li>Install news extension</li>
<li>Create and translate a sysfolder</li>
<li>Enable the option "records.contentElementRelation" in the news extension via extension manager </li>
<li>Add new news entry with a content element relation e.g. a text element</li>
<li>Translate the news record</li>
<li>Hit "Localize all records" on the content element relation of the translated record</li>
</ol>
<p>This will produce the following JavaScript error:</p>
<pre>
Uncaught TypeError: Cannot read property 'dom' of null
tree.js:73
</pre>
<p>The problem is, that somehow TYPO3 wants to update the form element <code>data[tt_content][{uid}][categories]</code> instead of <code>data[tx_news_domain_model_news][{uid}][categories]</code>. That leads to a JavaScript error because the element with the id <code>md5('data[tt_content][{uid}][categories]')</code> is not found.</p> TYPO3 Core - Bug #77946 (Closed): Fluid page link (f:link.page) to different pid using addQuerySt...http://forge.typo3.org/issues/779462016-09-14T14:11:42ZMarkus Mächleradmin@bithost.ch
<p>If you are for instance on a page with uid 1 and want to link to a page with uid 2 and set the addQueryString option, the link will be generated for uid 1 instead of 2.</p>
<p>e.g.</p>
<pre>
We are on page 1
<f:link.page pageUid="2" addQueryString="1">Page 2</f:link.page>
</pre>
<p>The problem is that the url builder creates a url that looks like <code>yourpage.com?id=2&id=1</code> where the second id parameter overwrites the first.<br />I feel like this issue should at least be addressed in <code>TYPO3\CMS\Fluid\ViewHelpers\Link\PageViewHelper</code> where the id parameter could be stripped away if the pageUid is set. It is very counter intuitive if there is a pageUid parameter present but not respected. It could also be fixed in <code>TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder</code> directly, although this might break other code.</p> TYPO3 Core - Task #77443 (Closed): Make "Page is being generated" configurablehttp://forge.typo3.org/issues/774432016-08-08T18:14:14ZMarkus Mächleradmin@bithost.ch
<p>The message "Page is being generated" still appears in TYPO3 7.6.10 after the page cache is cleared and concurrent page requests are made.</p>
<p>This should never be the case. Moreover, the hardcoded refresh time of 30s is not suitable either.</p>
<p>I suggest completely removing \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->tempPageCacheContent <br />and let the of the second request client wait until the page has been generated by the first request, <br />which will be the case since there is no "temporary content" in the database cache <br />and the lock for generating the page in the second request will be acquired as soon as the first request is processed, and subsequently the second request will retrieve the cached paged from the database.<br />See \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getFromCache </p>
<pre><code>public function getFromCache()
{<br /> ...<br /> $row = $this->getFromCache_queryRow();<br /> if (!is_array($row)) {<br /> // nothing in the cache, we acquire an exclusive lock now<br /> $this->acquireLock('pages', $lockHash);<br /> //<br /> // from this point on we're the only one working on that page ($lockHash)<br /> //<br /> // query the cache again to see if the data are there meanwhile<br /> $row = $this->getFromCache_queryRow();</code></pre>
<p>Therefore our very simple solution is to just remove the code in \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->tempPageCacheContent </p>
<pre><code>public function tempPageCacheContent(){}</code></pre>
<p>We have tested it and it works fine.</p>
<p>Moreover, I am not sure why the "accessLock" introduced in <a class="external" href="https://review.typo3.org/#/c/38840/">https://review.typo3.org/#/c/38840/</a> is necessary. <br />This lock is set regardless of the current page id being handled, and therefore temporarily blocks the concurrent page generation of different pages.</p>