TYPO3 Forge: Issueshttp://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692021-11-04T22:59:09ZTYPO3 Forge
Redmine TYPO3 Core - Bug #95877 (Closed): missing index "install_path" with composer 2.0http://forge.typo3.org/issues/958772021-11-04T22:59:09ZMarco Huber
<p>composer 2.0 doesn't set "install_path" in vendor/composer/installed.php like composer 2.1 does. This missing array index leads to a PHP notice in typo3/sysext/core/Classes/Core/Environment.php line 137 and because of some strange server configuration this breaks TYPO3 completly.</p>
<pre><code class="shell syntaxhl" data-language="shell"><span class="nv">$ </span>vendor/bin/typo3cms cache:flush
PHP Notice: Undefined index: install_path <span class="k">in</span> /custompath/private/typo3/sysext/core/Classes/Core/Environment.php on line 137
</code></pre> TYPO3 Core - Bug #94150 (Closed): Constants in Page TsConfig with multiple sites, caching problemhttp://forge.typo3.org/issues/941502021-05-18T07:39:24ZMarco Huber
<p>I think there is a problem with caching in \TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser, because it doesn't use the current site config in the cache identifier.</p>
<p>My test case with two sites:</p>
<p>config/sites/site-a/config.yaml:<br /><pre>
rootPageId: 1
settings:
access:
groupid: 1
</pre></p>
<p>config/sites/site-b/config.yaml:<br /><pre>
rootPageId: 2
settings:
access:
groupid: 2
</pre></p>
<p>Page TsConfig:<br /><pre>
TCEMAIN {
permissions {
groupid = {$access.groupid}
}
}
</pre></p>
<p>Clear the cache and then open the info modul and have a look at the page tsconfig for site-a, then {$access.groupid} is replaced with "1". But on site-b {$access.groupid} is not replaced. <br />Clear the cache again and open site-b first. Now {$access.groupid} is replaced on site-b with "2" but not on site-a.<br />Another test is to create pages and check the access rights in the Access module. The first site has the group set, the second site has no group set.</p>
<p>The related code should be in PageTsConfigParser:parse(). If I change `$hashOfContent = md5('PAGES:' . $content);` to `$hashOfContent = md5('PAGES:' . $content) . ($site ? $site->getIdentifier() : '');` then it works. But I'm not sure, if this is the best solution. I tested with 10.4 but the code in master is still the same. So the problem should exist there, too.</p>
<p>As a hotfix without changing the core an integrator can use good old conditions in the page TsConfig :-)<br /><pre>
[1 in tree.rootLineIds]
TCEMAIN {
permissions {
groupid = 1
}
}
[GLOBAL]
[2 in tree.rootLineIds]
TCEMAIN {
permissions {
groupid = 2
}
}
[GLOBAL]
</pre></p> TYPO3 Core - Bug #83741 (Closed): HTTP Basic Authentication credentials in Google Chrome 64 not t...http://forge.typo3.org/issues/837412018-01-31T16:07:23ZMarco Huber
<p>Our project is protected by a HTTP Basic Authentication and we have to enter the username/password on every d3.json() call in Google Chrome. In TYPO3 8.7 this function is called in the SvgTree.js to build the tree in the tt_content/categories field, in TYPO3 9.x it's called for every(?) tree.</p>
<p>This is a bug in the d3.js (4.10) library, but it affects every TYPO3 8.7 and 9.x. An Update to d3.js 4.13 doesn't help and in d3.js 5.0 there is a similar issue.</p>
<p><a class="external" href="https://github.com/d3/d3-request/issues/33">https://github.com/d3/d3-request/issues/33</a><br /><a class="external" href="https://github.com/d3/d3-fetch/issues/10">https://github.com/d3/d3-fetch/issues/10</a></p>
<p>A dirty workaround would be, to set the credentials with some javascript workaround. But I'm not sure if this is the right way. Berhaps the d3.js developers have some ideas on github.</p>
<p><img src="http://forge.typo3.org/attachments/download/33145/d3.png" alt="" loading="lazy" /></p> TYPO3 Core - Bug #82521 (Closed): Links to a mounted page in a page tree with a different domain ...http://forge.typo3.org/issues/825212017-09-20T14:26:36ZMarco Huber
<p>If you link to a page in another page tree with a different domain, the link gets prepended with the domain of the other page tree. But if the target page mounts another page, then the domain is not prepended. It seems like, as soon as the link has the GET parameter MP, the rootline check is not done.</p>
<p>This happens on typolinks, but also in menus and links from the RTE. Tested TYPO3 Versions are 6.2, 7.6 and 8.7.</p>
<p>A detailed testcase is attached.</p> TYPO3 Core - Bug #81740 (Closed): temp directory name shouldn't be hardcoded in ClearCacheServicehttp://forge.typo3.org/issues/817402017-06-29T11:36:36ZMarco Huber
<p>As the name of the temp directory can be configured (f.e. <pre><code class="php syntaxhl" data-language="php"><span class="nv">$GLOBALS</span><span class="p">[</span><span class="s1">'TYPO3_CONF_VARS'</span><span class="p">][</span><span class="s1">'SYS'</span><span class="p">][</span><span class="s1">'caching'</span><span class="p">][</span><span class="s1">'cacheConfigurations'</span><span class="p">][</span><span class="s1">'cache_core'</span><span class="p">][</span><span class="s1">'options'</span><span class="p">][</span><span class="s1">'cacheDirectory'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'typo3temp_local'</span><span class="p">;</span></code></pre>), the name "typo3temp" shouldn't be hardcoded in the ClearCacheService <a href="https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/install/Classes/Service/ClearCacheService.php#L42" class="external">Line 42</a> (<a href="https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_7-6/typo3/sysext/install/Classes/Service/ClearCacheService.php#L56" class="external">TYPO3 7.6 Line 56</a>).</p> TYPO3 Core - Bug #79711 (Closed): The CE File Links (fluid_styled_content) tries to create thumbs...http://forge.typo3.org/issues/797112017-02-09T15:40:01ZMarco Huber
<p>In typo3/sysext/fluid_styled_content/Resources/Private/Templates/Uploads.html line 13 the if condition is true even for non-image files, because the f:uri.image returns an url. But then the f:media viewhelper can't handle this files and returns an <img> tag with an invalid src.</p>
<p>To reproduce:<br />Insert the content element File Links on a page, assign some non-image files (docx, xlsx, ...) and select "Filename and thumbnail (if possible)" in the field "Display file/icon/thumbnail".<br />For this files the generated <img> tag looks like this: <img src="path/to/my.docx" /></p>
<p>As a quick workaround I wrote a little viewhelper to check, if the file extension is in $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], and used this viewhelper in the if condition:</p>
<pre>
<?php
namespace Vendor\MyTheme\ViewHelpers;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Checks if the file extension is in $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
*/
class IsImageViewHelper extends AbstractViewHelper
{
/**
* Checks if the file extension is in $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
*
* @param \TYPO3\CMS\Core\Resource\ResourceInterface $resource Either give this resource
* @return boolean
*/
public function render($resource)
{
return GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $resource->getExtension());
}
}
</pre>
<pre>
<f:if condition="{data.uploads_type} == 2">
<f:if condition="{vendor:isImage(resource:file)}">
<f:then>
<a href="{file.publicUrl}"{f:if(condition:data.target,then:' target="{data.target}"')}>
<f:media file="{file}" width="150" alt="{file.properties.alternative}" />
</a>
</f:then>
</pre>
<p>But perhaps there is a better solution?</p> TYPO3 Core - Bug #79012 (Closed): TYPO3 default language content shownhttp://forge.typo3.org/issues/790122016-12-16T11:26:45ZMarco Huber
<p>If a database field can be NULL, the default language content is shown even if there shouldn't be a fallback.</p>
<p><a class="external" href="http://stackoverflow.com/questions/41181974/typo3-default-language-content-shown">http://stackoverflow.com/questions/41181974/typo3-default-language-content-shown</a></p> TYPO3 Core - Bug #78918 (Closed): Pasting long text into the RTE leads to browser crasheshttp://forge.typo3.org/issues/789182016-12-08T10:14:57ZMarco Huber
<p>The browser crashes, if you copy a long text into the RTE. This happens always in the IE and if you open the developer toolbar it happens in the firefox, too.</p>
<p>I think the reason is this patch: <a class="external" href="https://review.typo3.org/#/c/44810/">https://review.typo3.org/#/c/44810/</a></p>
<p>The event DOMSubtreeModified is triggered very often on changes in the RTE. And because everytime the event is triggered a complete form validation is startet, the script runtime gets to long and makes the browser crash.<br />How often the event is triggered depends on which transformations are done while pasting content into the RTE. I mean, which tags and attributes are allowed and which should be removed and so on.</p>
<p>Examples:<br />1. If you make a linebreak in an empty RTE, then the event is triggered 3 times.<br />2. If you paste the text "asd" into an emtpy RTE, then the event is triggered 1 time.<br />3. If you paste the two textblocks "TYPO3 Schulungen" and "TYPO3 Hosting" from <a class="external" href="https://typo3.bgm-gmbh.de/leistungen/">https://typo3.bgm-gmbh.de/leistungen/</a> into an empty RTE, then the event is triggered more than 30 times (then my browser crached ;-)).<br />3.1 If you deaktivate the validation in the function Editor.prototype.onDOMSubtreeModified, then the event ist triggered "only" 9 times.</p>
<p>To count how often the event is triggered I added this code to the function Editor.prototype.onDOMSubtreeModified:<br /><pre>
this.onDOMSubtreeModifiedCounter = this.onDOMSubtreeModifiedCounter || 0;
this.onDOMSubtreeModifiedCounter++;
console.log(this.onDOMSubtreeModifiedCounter);
</pre></p>
<p>Perheps there is a better event to start the validation? Perheps when the hidden textarea is updated? But I haven't found the place where this happens.</p> TYPO3 Core - Bug #76974 (New): Translation handling with starttime/stoptimehttp://forge.typo3.org/issues/769742016-07-07T10:59:10ZMarco Huber
<p>I hope this is no duplicate, but I didn't find an issue here on forge and on Slack (<a class="external" href="https://typo3.slack.com/archives/typo3-cms/p1467294284003213">https://typo3.slack.com/archives/typo3-cms/p1467294284003213</a>) was no reaction on my question...</p>
<p>Because we had some issues with language handling and starttime/stoptime, I made some tests with different configurations and TYPO3 versions. These are the results, perhaps they are usefull for someone else, too.</p>
<p><a class="external" href="https://gist.github.com/mhuber84/9da479f5410fe4c1abceea90cce6baf2">https://gist.github.com/mhuber84/9da479f5410fe4c1abceea90cce6baf2</a></p>
<p>I didn't find an issue on forge for Configuration 1, Test 06, 08, 14 and 16 (everything the same). Any hints?<br />And, for our usecase, Configuration 4 with TYPO3 7.6 would match best. But only if I can solve the ERROR in Test 11 and 12. Are there any chances to make this work?</p> TYPO3 Core - Bug #72751 (Closed): RTE: no TSconfig loaded on positioned inserthttp://forge.typo3.org/issues/727512016-01-15T21:16:37ZMarco Huber
<p>If you insert a content element (or a page) with a RTE field at a concrete position f.e. after content element 15 the value in $row['pid'] is -15.</p>
<p>But with this "pid" the TSconfig can not be loaded.</p> TYPO3 Core - Bug #68367 (Rejected): checkSubmit should wait 500mshttp://forge.typo3.org/issues/683672015-07-19T12:50:56ZMarco Huber
<p>Steps to reproduce:<br />Create a new record which has a required field. Insert something in the required field. Click on save. The alert "The fields marked with an exclamation mark are not yet correctly filled in. Please complete them properly." is shown.</p>
<p>You have to click somewhere else before you click on save.</p>
<p>Because of the setTimeout in typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js Line 59-62 around "FormEngineValidation.validate();" the checkSubmit function should also wait 500ms before it tries to submit the form.</p> TYPO3 Core - Bug #65364 (Closed): _languageUid gets overwritten on updating a new domain object.http://forge.typo3.org/issues/653642015-02-26T17:56:44ZMarco Huber
<p>When creating a new domain object the property _languageUid is NULL. When this object gets persisted \TYPO3\CMS\Extbase\Persistence\Generic\Backend::insertObject() sets the language field to "-1" like it is described in the documentation <a class="external" href="http://docs.typo3.org/typo3cms/ExtbaseFluidBook/9-CrosscuttingConcerns/1-localizing-and-internationalizing-an-extension.html#multi-language-domain-objects">http://docs.typo3.org/typo3cms/ExtbaseFluidBook/9-CrosscuttingConcerns/1-localizing-and-internationalizing-an-extension.html#multi-language-domain-objects</a>. But after the insert the objects are updated (f.e. to insert missing relation ids and stuff) immediately and persisted again. \TYPO3\CMS\Extbase\Persistence\Generic\Backend::updateObject() sets "$row[$dataMap->getLanguageIdColumnName()] = $object->_getProperty('_languageUid');" and because the object's property _languageUid is NULL a 0 is inserted in the database.</p>
<p>So if the object was created in a multi language environment (sys_language_uid > 0) extbase doesn't find it anymore.</p>
<p><strong>Solution 1:</strong><br />Update the object's property _languageUid in \TYPO3\CMS\Extbase\Persistence\Generic\Backend::insertObject(). But this should be done only, if the developer hasn't set _languageUid himself (see FORGE). Then the update finds the -1 in the property _languageUid and everything works like it is documentated.</p>
<pre>
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
index 8c6e3f0..b7f1efd 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
@@ -635,6 +635,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
$this->addCommonFieldsToRow($object, $row);
if ($dataMap->getLanguageIdColumnName() !== NULL && ($object->_getProperty('_languageUid') === NULL || !$object->_getProperty('_languageUid'))) {
$row[$dataMap->getLanguageIdColumnName()] = -1;
+ $object->_setProperty('_languageUid', -1);
}
if ($parentObject !== NULL && $parentPropertyName) {
$parentColumnDataMap = $this->dataMapper->getDataMap(get_class($parentObject))->getColumnMap($parentPropertyName);
</pre>
<p><strong>Solution 2:</strong><br />Do "$row[$dataMap->getLanguageIdColumnName()] = $object->_getProperty('_languageUid');" only if _languageUid is not NULL in \TYPO3\CMS\Extbase\Persistence\Generic\Backend::updateObject().</p>
<pre>
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
index f3d89c9..c6aeb59 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
@@ -850,7 +850,9 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
$this->addCommonFieldsToRow($object, $row);
$row['uid'] = $object->getUid();
if ($dataMap->getLanguageIdColumnName() !== NULL) {
- $row[$dataMap->getLanguageIdColumnName()] = $object->_getProperty('_languageUid');
+ if($object->_getProperty('_languageUid') !== NULL){
+ $row[$dataMap->getLanguageIdColumnName()] = $object->_getProperty('_languageUid');
+ }
if ($object->_getProperty('_localizedUid') !== NULL) {
$row['uid'] = $object->_getProperty('_localizedUid');
}
</pre>
<p>I would prefer the first solution, because it seems cleaner to me. Or should both solutions be implemented?</p>
<p>If someone has a good idea for a commit message I will submit a patch to gerrit.</p> TYPO3 Core - Bug #65363 (Closed): Set _languageUid to -1 only if the developer hasn't set it himselfhttp://forge.typo3.org/issues/653632015-02-26T17:52:58ZMarco Huber
<p>When new domain objects get persisted the language field (sys_language_uid) is set to -1 in \TYPO3\CMS\Extbase\Persistence\Generic\Backend::insertObject(). There should be a check if the developer hasn't set it himself.</p>
<pre>
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
index f3d89c9..8c6e3f0 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
@@ -633,7 +633,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
$dataMap = $this->dataMapper->getDataMap(get_class($object));
$row = array();
$this->addCommonFieldsToRow($object, $row);
- if ($dataMap->getLanguageIdColumnName() !== NULL) {
+ if ($dataMap->getLanguageIdColumnName() !== NULL && ($object->_getProperty('_languageUid') === NULL || !$object->_getProperty('_languageUid'))) {
$row[$dataMap->getLanguageIdColumnName()] = -1;
}
if ($parentObject !== NULL && $parentPropertyName) {
</pre>
<p>If someone has a good idea for a commit message I will submit a patch to gerrit.</p> TYPO3 Core - Bug #53622 (Closed): Updating the file content fails with the FAL APIhttp://forge.typo3.org/issues/536222013-11-13T18:51:48ZMarco Huber
<p>Creating/Updating files with the FAL API fails because FAL want's to update a field sys_file.mimetype. But the field is called sys_file.mime_type in the database.</p>
<p>To reproduce:<br /><pre>
/** @var \TYPO3\CMS\Core\Resource\StorageRepository $storageRepository */
$storageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\StorageRepository');
/** @var \TYPO3\CMS\Core\Resource\ResourceStorage $storage */
$storage = $storageRepository->findByUid(1);
//Create a file (or get an existing one, that makes no difference):
/** @var \TYPO3\CMS\Core\Resource\Folder $folder */
$folder = $storage->getFolder('/user_upload/');
$fileName = '123.txt';
$file = $storage->createFile($fileName, $folder); //A new record in sys_file is created and the file is created in the filesystem.
//Update the file
$fileContent = '12345filecontent';
$file->setContents($fileContent); //The file's content in the filesystem get's updated. But the mimetype changes and can not be updated in the database.
//this one throws the same error: $storage->setFileContents($file, $fileContent);
</pre></p>
<p>The error:<br /><pre>
exec_UPDATEquery
caller: TYPO3\CMS\Core\Database\DatabaseConnection::exec_UPDATEquery
ERROR: Unknown column 'mimetype' in 'field list'
lastBuiltQuery: UPDATE sys_file SET mimetype='text/plain' WHERE uid=2071
debug_backtrace:
include(ysext/extbase/Scripts/CommandLineLauncher.php),li_dispatch.phpsh#65
TYPO3\CMS\Extbase\Core\Bootstrap->run#32
TYPO3\CMS\Extbase\Core\Bootstrap->handleRequest#197
TYPO3\CMS\Extbase\Mvc\Cli\RequestHandler->handleRequest#208
TYPO3\CMS\Extbase\Mvc\Dispatcher->dispatch#96
TYPO3\CMS\Extbase\Mvc\Controller\CommandController->processRequest#100
TYPO3\CMS\Extbase\Mvc\Controller\CommandController->callCommandMethod#114
call_user_func_array#212
BGM\MyExt\Command\MyCommandController->createFileCommand#
TYPO3\CMS\Core\Resource\File->setContents#84
TYPO3\CMS\Core\Resource\ResourceStorage->setFileContents#140
TYPO3\CMS\Core\Resource\FileRepository->update#952
TYPO3\CMS\Core\Database\DatabaseConnection->exec_UPDATEquery#263
TYPO3\CMS\Core\Database\DatabaseConnection->debug#247
</pre></p>
<p>The problem is $file->setContents which calls TYPO3\CMS\Core\Resource\FileRepository->update, but I have no idea how to fix this.</p> TYPO3 Core - Bug #20706 (Closed): Russian chars in the comments are encoded wrong when changing t...http://forge.typo3.org/issues/207062009-07-01T14:35:43ZMarco Huber
<p>In the Versioning-Modul:<br />When you change the stage for an element, for example sending it to the reviewer, a javascript popup box opens where you can enter a comment. When you enter russian chars they aren't stored correct. This is because the comment is sended through the javascript function escape().<br />The better way is to send it through encodeURI(), or perhaps through encodeURIComponent().<br />So you have to replace the string escape(commentTxt) with encodeURI(commentTxt) in the file typo3/sysext/version/cm1/index.php. You'll find it three times in this files.<br />Perhaps there are some more files where you have to replace it. Until now I only found this one.<br />It would be nice if this little change would find its way to the next TYPO3-Versions... ;-)</p>
<p>(issue imported from #M11458)</p>