TYPO3 - TCA Migrations - Informational or ToDo? - typo3

I'm a newbie in typo3. A friend of me asked, if I can upgrade his installation for him, because I'm a developer. So I checked if I can do it.
I did several steps to upgrade the installation from 7.6.9 to 8.7.3. Now I ended in the installation tool in the section important actions. There is a point TCA migrations.
There it says:
TCA migrations need to be applied Check the following list and apply
needed changes.
The icon path of wizard "link" from TCA table
"tx_myredirects_domain_model_redirect['columns']['destination']['config']['wizards']['link']['icon']"has
been migrated to
tx_myredirects_domain_model_redirect['columns']['destination']['config']['wizards']['link']['icon']"
= 'actions-wizard-link'. ...
Is this just informational or do I have to modify something in the things listed?
Sorry again, if this is a newbie question, but I am actually a newbie in typo3.

If the extensions that need to migrate the TCAs haven't been created by you, then no, you do not really need to change them. The author of the extension should do it, because if you change them and then the author releases an update, then all your changes will be lost.
If the extension is a custom extension, then it would be better to migrate them. Then you can avoid bugs and unwanted disfunctions.
If you have a sitepackage, you can override the TCA's and give them new definitions. This way, if the author releases an update, your TCAs won't be lost. In order to do that, you can follow these instructions:
Extending TCAs
An example would be:
your_sitepackage/Configuration/TCA/Overrides/tx_tablename_domain_model_modelname
$GLOBALS['TCA']['tx_tablename_domain_model_modelname']['columns']['columnYouNeedToChange'] = [
'label' => 'input_29 link',
'config' => [
'type' => 'input',
'wizards' => [
'link' => [
'type' => 'popup',
'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel',
'icon' => 'actions-wizard-link',
'module' => [
'name' => 'wizard_link',
],
'JSopenParams' => 'height=800,width=600,status=0,menubar=0,scrollbars=1',
'params' => [
'blindLinkOptions' => 'folder',
'blindLinkFields' => 'class, target',
'allowedExtensions' => 'jpg',
],
],
],
]
This for example would solve the first problem of the image you shared. You just need to replace the table name. (That's TYPO3v8. TYPO3 v9 has more changes when it comes to TCAs)
If you are not sure how the path to the column look like ($GLOBALS['TCA']['tx_tablename_domain_model_modelname']['columns']['columnYouNeedToChange']) then follow this:
TCA Paths
#Thomas Löffler is right. It would be very useful to create an issue on GitHub and let the author know that some changes need to be made.
Best regards

This will show which TCA fields have been identified to have a legacy format and have been transformed while loading the configuration files.
While it is good practice to do these changes and keep this clean, strictly speaking it is not required.
Tip: I would rather look there before an upgrade because deprecated stuff might still have an upgrade path in an older version but none in the newest.

Related

Multiple extension extend one extension in TYPO3 10

Szenario:
I have two extensions, which extend ext:news with some specific fields. Up to TYPO3 9 I had to configure the dependency to the news extension with the following TypoScript configuration:
config.tx_extbase {
persistence {
classes {
GeorgRinger\News\Domain\Model\News {
subclasses {
GeorgRinger\News\Domain\Model\News = Vendor\Extension\Domain\Model\News
}
}
Vendor\Extension\Domain\Model\News {
mapping {
tableName = tx_news_domain_model_news
}
}
}
}
}
The model Vendor\Extension\Domain\Model\News extends the model of the "base" extension:
class News extends \GeorgRinger\News\Domain\Model\News
In TYPO3 10 the TypoScript configuration was replaced with the following configuration in Configuration/Extbase/Persistence/Classes.php (Breaking: #87623):
\Vendor\Extension\Domain\Model\News::class => [
'tableName' => 'tx_news_domain_model_news',
'recordType' => 0,
],
This works as long, as you have just one extension which extends the news extension. If you have a second extension and enable the TYPO3 cache you will get an error, that the fields which are added in the first extension are not available in the templates of the news extension. The strange part is, that this problem only occurs, when enabling the cache!
So my question is:
What is the right way to add some fields to an existing extension in TYPO3 10?
As the changelog says, in TYPO3 versions below 10, your overriding configuration was located in typoscript. Since 10 LTS, it is located in a PHP class. As a consequence, the mechanism which controls loading order is no more the one for typoscript but the one for PHP.
Authoritative for the PHP loading order is the constraints section in the ext_emconf.php files of your extensions. They are parsed at first run and cached afterwards. The composer.json files do not control loading order - currently they only serve the purpose of resolving dependencies in composer itself.
In contrast to composer.json, the ext_emconf.php allows you to specify not only hard but also "soft" dependencies, which you can set using the suggests keyword. This way, you can specify loading order between extensions without them having to be installed in any case. This allows you to install each extension independently from the other, while you can still specify correct loading order in case they are both installed.
So, in your case, the second extension needs to have a soft "suggests" dependency to the first one:
constraints' => [
'depends' => [
],
'conflicts' => [
],
'suggests' => [
'news' => ''
'first_news_extension' => ''
],
]
See the complete explanation of constraints in ext_emconf here.

How to manage different versions of application by using plugins in cakephp 3?

I have a single cakephp 3 application
I have a generic view which render data depending of an array struture of fields configured in each Model, this array includes configurations for display each field in the view like (text titles, maxsize, sortable, etc..) and database configuration like (column name in the database/table, datatype, etc..) in the same array, and its working fine.
public $tableData = [
[
'name' => 'Table1.name',
'title' => 'Name',
'field' => 'name',
'sortable' => true,
'type' => 'string',
'size' => '50px',
],
[
'name' => 'Asosiation1.option',
'title' => 'Topic',
'field' => 'topic_option',
'sortable' => true,
'type' => 'string',
'size' => '150px',
],
... More fields and asosiations
]
But now, i need to have these same Models in different versions, because the structure of the database/table for each Model change every year, but i need to preserv/show the data corresponding to each version as it is.
So if a user request mySite.com/2010, Site must show data using Model array structure defined for that year especifically.
So, i created:
/plugins/Years/version2010
/plugins/Years/version2011
etc..
and in each pluging, I copied all Models changing only the namespace, defaultConnectionName (1 schema per Year) and array structure.
This provokes to have mutiple plugins loaded in bootstrap config.
Is there any way to load only the necesary plugin depending of the request ?(/2010, /2011, etc..)
Ex. In bootstrap.php I do for each plugin year:
Plugin::load('Years/version201X', ['bootstrap' => false, 'routes' => true]);
also
Is there any way to avoid having to specify the plugin name every time i do loadModel() or TableRegistry::get() ?
Ex. In main App GeneralController I have to do every time:
$this->loadModel('Years/version201X/Table1');
Or maybe there is another better approach to solve this situation i havent seen
Is there any way to load only the necesary plugin depending of the
request ?(/2010, /2011, etc.
Yes. Inside config/bootstrap.php you can check the request uri and then have a switch statement for the plugins. Something like this:
$uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_SPECIAL_CHARS);
// might need explode('/', $uri); to extract the right URL component
switch ($uri) {
case '2011':
// load plugin
break;
case '2012':
// log plugin
break;
}
You probably dont even need the switch statement, be creative there. Obviously thats not exact, but if gives you the right idea.
Is there any way to avoid having to specify the plugin name every time
i do loadModel() or TableRegistry::get() ?
If the model is unique to the plugin then I am not sure how you get away with this. Whats the problem though? Just a few extra characters. Sounds like you only have to do this once per year, right? However, you might not have to specify that if you're within the scope of the plugin. I am not sure on that, but its worth trying.

Typo3 Realurl urlcache is messed up by gclid-parameter

We use Google-Adwords for some campaigns which ads a gclid=xxxxx parameter to the URL.
Unfortunately, this messes up the RealUrl tables and when the page is called next time it results in a 404-error.
Is there any way to make RealUrl ignore this particular parameter?
This is claimed to be solved on GitHub:
https://github.com/dmitryd/typo3-realurl/issues/377
Anyways I still had that problem that the gclid triggers a urldata entry which causes a redirect loop. For now I solved it with removing the gclid from the ignoredGetparameters Filter and then banning it:
'cache' => array( // removed gclid from the filter, then ban it
'ignoredGetParametersRegExp' => '/^(?:utm_[a-z]+|pk_campaign|pk_kwd|TSFE_ADMIN_PANEL.*)$/'
'banUrlsRegExp' => '/gclid|tx_solr|tx_indexed_search|(?:^|\?|&)q=/',
),
Go to the Install Tool and add the parameter to [FE][cHashExcludedParameters].
Since realurl 2, there is a new possibility to control entries to tx_realurl_urldata:
https://github.com/dmitryd/typo3-realurl/wiki/Configuration-reference#banurlsregexp
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
//[...]
'cache' => array(
'banUrlsRegExp' => '/gclid|tx_solr|tx_indexed_search|(?:^|\?|&)q=/'
),
//[...]
Works like a charm, didn't knew until today this option even exists.

TYPO3, Realurl, News and mutilanguage

I have a TYPO3 multilanguage site, and I am trying to configure Realurl and
News. Question is: for single/detailed News urls, how do I get both
speaking and language localized versions?
I mean, I am able to get:
localhost/it/paginaSingola/news/detail/News/titolo-singolo
localhost/en/singlePage/news/detail/News/single-title
but I wish something like:
all italian >> localhost/it/paginaSingola/notizie/singola/Notizie/titolo-singolo
all english >> localhost/en/singlePage/news/detail/News/single-title
I am not even sure whether it is a Realurl or a News issue.
In the former case, do I need to define valueMap for postVarSets? How
do I do that?
TYPO3 6.2.13
News 3.2.2
Realurl 1.13.4
sr_language_menu 6.0.7
cheers
mario
This is not possible with realurl 1.x but it can be changed in realurl 2.x. You can write a feature request here: https://github.com/dmitryd/typo3-realurl/issues
RealURL 2.0 is expected to arrive to TER soon. It is already operational except for mount point support and BE module. BE module is in the active development right now.
Edit (March 01, 2016): this is now possible with RealURL 2.x. Basically you create a copy of your configuration and give it another name. Normally you have _DEFAULT, now you do something like _lang1. Than you use _DOMAINS to say that your L=1 should use _lang1:
'_DOMAINS' => array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => 0,
'useConfiguration' => '_DEFAULT',
),
array(
'GETvar' => 'L',
'value' => 1,
'useConfiguration' => '_lang1',
)
),
In your _lang1 you define a different prefix for a postVarSet.
That's all.
I'd be surprised if you didn't figure it out by the bottom of this: https://docs.typo3.org/typo3cms/extensions/news/3.0.0/Main/Administration/Realurl/Index.html

TYPO3 new record appearing on wrong location in Backend List

I'm developing a new extension using ExtBase in TYPO3 (4.7) for a client.
I have however the strangest problem. In the back-end, my possible, new record types are - as usual - listed in the Insert new record Backend List. Usually each of these record-types are preceded by the module name (actually they are grouped right after the module name).. However, in my case, 1 or 2 of the record-types of any other extension appear within my extension's list as well.. I've been trying to figure out pretty much all that I can, I even copied the extension over to an entirely different TYPO3 installation, but the same problem persists..
If of any extension some records appear just below my extension's title, and I delete that particular extension, just some other record-types appear of another extension.
What's going on here??
Short & late answer:
i guess you have defined the title of your models in two different ways or with a non-existent languagefile in your ext_tables.php. Something like this:
Model1:
$TCA['tx_aaext_domain_model_one'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:bn_news/Resources/Private/Language/locallang_db.xml:tx_bnnews_domain_model_categories',
Model2:
$TCA['tx_aaext_domain_model_two'] = array(
'ctrl' => array(
'title' => 'Static Title',
and/or your extension-name has an underscore like aa_extension, then this error can happen.
Make sure that both title-definitions are dynamic and begin with "LLL:EXT:" and point to an existing translation. Everything should be fine now.
Long answer will be to long :)