TYPO3 object storage is empty - typo3

i wanna ad a relation from one model to a nother.
/**
* #var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* #inject
*/
protected $objectManager;
/**
* action create
*
* #param \ReRe\Rere\Domain\Model\Modul $newModul
* #return void
*/
public function createAction(\ReRe\Rere\Domain\Model\Modul $newModul) {
$this->addFlashMessage('The object was created. Please be aware that this action is publicly accessible unless you implement an access check. See Wiki', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
$this->modulRepository->add($newModul);
// Erzeugt ein Leeres Fach
$fachHelper = new \ReRe\Rere\Domain\Model\Fach();
$fach = $this->objectManager->create('\ReRe\Rere\Domain\Model\Fach');
// Fach Werte setzen
$fach->setFachname($this->request->getArgument('fachname'));
$fach->setFachnr($this->request->getArgument('fachnummer'));
$fach->setPruefer($this->request->getArgument('pruefer'));
$fach->setNotenschema($this->request->getArgument('notenschema'));
// Fach einem Modul zuordnen
$fach->setModulnr($newModul->getModulnr());
//$request = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("\ReRe\Rere\Domain\Model\Fach");
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($newModul);
// Fach speichern
$this->fachRepository->add($fach);
$newModul->addFach($fach);
$this->redirect('list');
}
in database in modul the relationcounter will increased ...
DB looks like this:
but if I want to render the view like this:
<f:for each="{moduls}" as="modul">
{modul.modulname}
<f:for each="{modul.fach}" as="fach">
{fach.fachname}
no fach objects were printed ..
if I do <f:debug> of modul i got this:
Here The TCA-Configs:
Modul:
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$GLOBALS['TCA']['tx_rere_domain_model_modul'] = array(
'ctrl' => $GLOBALS['TCA']['tx_rere_domain_model_modul']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, modulnr, modulname, gueltigkeitszeitraum, fach',
),
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, modulnr, modulname, gueltigkeitszeitraum, fach, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'),
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'sys_language_uid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => array(
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
),
'l10n_parent' => array(
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => array(
'type' => 'select',
'items' => array(
array('', 0),
),
'foreign_table' => 'tx_rere_domain_model_modul',
'foreign_table_where' => 'AND tx_rere_domain_model_modul.pid=###CURRENT_PID### AND tx_rere_domain_model_modul.sys_language_uid IN (-1,0)',
),
),
'l10n_diffsource' => array(
'config' => array(
'type' => 'passthrough',
),
),
't3ver_label' => array(
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => array(
'type' => 'input',
'size' => 30,
'max' => 255,
)
),
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => array(
'type' => 'check',
),
),
'starttime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'endtime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'modulnr' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_modul.modulnr',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'modulname' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_modul.modulname',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'gueltigkeitszeitraum' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_modul.gueltigkeitszeitraum',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'fach' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_modul.fach',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tx_rere_domain_model_fach',
'foreign_field' => 'modulnr',
'maxitems' => 9999,
'appearance' => array(
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
),
),
),
),
);
And TCA Fach
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
$GLOBALS['TCA']['tx_rere_domain_model_fach'] = array(
'ctrl' => $GLOBALS['TCA']['tx_rere_domain_model_fach']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, fachnr, fachname, pruefer, notenschema, modulnr, matrikelnr',
),
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, fachnr, fachname, pruefer, notenschema, modulnr, matrikelnr, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'),
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'sys_language_uid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => array(
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
),
'l10n_parent' => array(
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => array(
'type' => 'select',
'items' => array(
array('', 0),
),
'foreign_table' => 'tx_rere_domain_model_fach',
'foreign_table_where' => 'AND tx_rere_domain_model_fach.pid=###CURRENT_PID### AND tx_rere_domain_model_fach.sys_language_uid IN (-1,0)',
),
),
'l10n_diffsource' => array(
'config' => array(
'type' => 'passthrough',
),
),
't3ver_label' => array(
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => array(
'type' => 'input',
'size' => 30,
'max' => 255,
)
),
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => array(
'type' => 'check',
),
),
'starttime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'endtime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'fachnr' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_fach.fachnr',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'fachname' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_fach.fachname',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'pruefer' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_fach.pruefer',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'notenschema' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_fach.notenschema',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'modulnr' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_fach.modulnr',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'matrikelnr' => array(
'exclude' => 1,
'label' => 'LLL:EXT:rere/Resources/Private/Language/locallang_db.xlf:tx_rere_domain_model_fach.matrikelnr',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_rere_domain_model_pruefling',
'MM' => 'tx_rere_fach_pruefling_mm',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
'wizards' => array(
'_PADDING' => 1,
'_VERTICAL' => 1,
'edit' => array(
'type' => 'popup',
'title' => 'Edit',
'script' => 'wizard_edit.php',
'icon' => 'edit2.gif',
'popup_onlyOpenIfSelected' => 1,
'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
),
'add' => Array(
'type' => 'script',
'title' => 'Create new',
'icon' => 'add.gif',
'params' => array(
'table' => 'tx_rere_domain_model_pruefling',
'pid' => '###CURRENT_PID###',
'setValue' => 'prepend'
),
'script' => 'wizard_add.php',
),
),
),
),
'modul' => array(
'config' => array(
'type' => 'passthrough',
),
),
'note' => array(
'config' => array(
'type' => 'passthrough',
),
),
),
);

The model class looks ok and all annotations seem to be correct.
Could you please post your TCA configuration for both Modul and Fach (the relation entry for both should be enough).
Quick question, are you able to see the relations between the two objects in the backend and if so, can you see it from both sides?
Go to the BE and check with the list tool if you can see related "Fach" objects in a "Modul" object and vise versa.
Maybe the TCA relation is no set up correctly and you can only access the relation from one side.
From which side have you created the relations (Modul->Fach or Fach->Modul)?
Of course it should be working either way.
UPDATE 1
Does the column "modulnr" in your table "tx_rere_domain_model_fach" contain the correct Modul-UIDs?
-> To speed the process up, could you send me a download link to your extension? I would then install it on a test system and we will quickly find out what is wrong.
UPDATE 2
I found what is going wrong in your extension. After creating a new Modul and Fach the class \ReRe\Rere\Controller\ModulController handles the form data. In line 116
$fach->setModulnr($newModul->getModulnr());
the value for the reference, which should be the UID of the Modul is set to the Modulnr. As the reference to the foreign table is configured to be the UID, the UID of the Modul needs to be set here. Change the line to the following and it works:
$fach->setModulnr($newModul->getUid());
You will have to change this in every controller action that creates a new Fach-Modul relation. So this is only an example of what you need to do.
Sidenote
As an additional tip, you might want to take a look into the best practises on how to handle form data in Extbase.
Calls like this
$fach->setFachnr($this->request->getArgument('fachnummer'));
will work but open up a world of pain when it comes to injections, as there is no validation etc.
A very easy and quick way to set up basic validation and also make your code much more readable is to use annotations and parameters in your controller action. So instead of getting the arguments yourself, let the framework to the work for you:
/**
* action create
*
* #param \ReRe\Rere\Domain\Model\Modul $newModul
* #param string $fachname
* #param int $fachnummer
*/
public function createAction(\ReRe\Rere\Domain\Model\Modul $newModul, $fachname, $fachnummer) {
...
If you want to make a parameter optional, just give it a value in the method call:
public function createAction(\ReRe\Rere\Domain\Model\Modul $newModul, $fachname = "foo", $fachnummer="bar") {
...
As I said, this is just a tip, you might want to consider :)

Please check if the ObjectStorage is related to the correct class in your model. Sometimes the extensionbuilder does set up the ObjectStorage but messes up the annotation.
Check if the annotation for "fach" in your ReRe\Rere\Domain\Model\Modul class contains the referenced class. It should look like this:
#var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\ReRe\Rere\Domain\Model\Fach>
If assume your looks just like this, which is wrong and leads to an empty ObjectStorage in the FE:
#var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<>
See how the class the ObjectStorage contains is missing.

Related

Where to influence in which languages an extbase record can be translated?

In a custom built TYPO3 extension, records are only available in language -1 in the backend. That was specified as such, but should now be changed so records can be translated.
Something is missing. I thought this would be in TCA, but the definitions look quite normal:
'columns' => [
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'special' => 'languages',
'items' => [
[
'LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages',
-1,
'flags-multiple'
]
],
'default' => 0,
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => true,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['', 0],
],
'foreign_table' => 'tx_myext_domain_model_item',
'foreign_table_where' => 'AND tx_myext_domain_model_item.pid=###CURRENT_PID### AND tx_myext_domain_model_item.sys_language_uid IN (-1,0)',
],
],
Also, when I change TCA, for example change config as such:
'config' => array(
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
It's still the same: only language -1 (ALL) is selectable.
Of course, the sysfolder those records are on is translated in multiple languages. Also, the columns for sys_language_uid, l10n_parent and l10n_diffsource are present in the database.
Are the other languages maybe disabled somewhere? Where else could I look?
Or which element could be missing else to make records translateable?
Thanks for any hint.

TYPO3 - Use language specific path instead of language prefix with realurl

I have setup an TYPO3-installation (7.6) with the languages in a single tree solution. So using realurl (2.3.1) I get the German version of a page with the following url: www.domain.com/de/pfad-zur-seite and the English version with the url www.domain.com/en/path-to-page.
Now the different language versions should be available by different paths.
The German version should be
www.domain.com/gruppe/magazin/pfad-zur-seite
the English version
www.domain.com/group/magazine/pfad-zur-seite
So the language prefix de should be substituted by gruppe/magazin, the language prefix en substituted by group/magazine. I tried changing this in the realurl_conf.php preVars-Section. But there is only one Segment (i.e. group) allowed not to segments (group/magazine).
How can I get the desired urls?
Here are my realurl and TYPO3 settings:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
'_DEFAULT' => array(
'init' => array(
'enableCHashCache' => 1,
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
'postVarSet_failureMode' => '',
),
'redirects' => array(),
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'en' => '1',
),
'valueDefault' => 'en',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 7,
'rootpage_id' => 1,
'firstHitPathCache' => 1,
),
// postVars
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
)
)
),
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'50' => 'newsDetailConfiguration',
'8' => 'newsCategoryConfiguration',
'8' => 'newsTagConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
)
),
'dateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
'page' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
),
),
// configure filenames for different pagetypes
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'index' => array(
'print.html' => array(
'keyValues' => array(
'type' => 98,
),
),
'rss.xml' => array(
'keyValues' => array(
'type' => 100,
),
),
'rss091.xml' => array(
'keyValues' => array(
'type' => 101,
),
),
'rdf.xml' => array(
'keyValues' => array(
'type' => 102,
),
),
'atom.xml' => array(
'keyValues' => array(
'type' => 103,
),
),
),
),
),
);
Typoscript:
The default language changed during the development. That's why sys_language_uid = 1 is chosen as default language.
config {
linkVars = L(0-1)
uniqueLinkVars = 1
htmlTag_dir = ltr
htmlTag_langKey = en
sys_language_uid = 1
language = en
locale_all = en_EN
sys_language_overlay = hideNonTranslated
# sys_language_overlay = content_fallback
sys_language_mode = strict
}
# German language, sys_language.uid = 0
[globalVar = GP:L = 0]
config {
language = de
locale_all = de_DE.utf8
htmlTag_langKey = de
sys_language_uid = 0
}
[global]
# English language, sys_language.uid = 1
[globalVar = GP:L = 1]
config {
language = en
locale_all = en_EN.utf8
htmlTag_langKey = en
sys_language_uid = 1
}
[global]

TYPO3 object storage add existing item

I have typo3 7.6.18. I need to add an existing item to an object storage. I see that it doesn't add the item.
$editUser = $this->userRepository->findByUid($userUid);
$newSmile = $this->serviceRepository->findByUid($smileUid);
if ($editUser && $newSmile) {
$smileUid = $newSmile->getUid();
$editUser->addSmile($newSmile);
$this->userRepository->update($editUser);
$persistenceManager->persistAll();
}
Help me please.
Model user, all that touch smile object storage. I added my User model. Sorry I must write something. I must write more.
/**
* smiles
*
* #var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Fhk\Feusersplus\Domain\Model\Service>
*/
protected $smile = '';
/**
* Returns the smiles
*
* #return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Fhk\Feusersplus\Domain\Model\Service> $smile
*/
public function getSmile()
{
return $this->smile;
}
/**
* Sets the smile
*
* #return void
*/
public function setSmile($smile)
{
$this->smile = $smile;
}
/**
* Adds a smile to the smile
*
* #param \Fhk\Feusersplus\Domain\Model\Service $smile
* #return void
* #api
*/
public function addSmile(\Fhk\Feusersplus\Domain\Model\Service $smile)
{
$this->smile->attach($smile);
}
/**
* Removes a smile from the smile
*
* #param \Fhk\Feusersplus\Domain\Model\Service $smile
* #return void
* #api
*/
public function removeSmile(\Fhk\Feusersplus\Domain\Model\Service $smile)
{
$this->smile->detach($smile);
}
TCA of table tx_feusersplus_domain_model_usersmile
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:feusersplus/Resources/Private/Language/locallang_db.xlf:userSmile',
'label' => 'uid_local',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'sortby' => 'sorting',
'hideTable' => true,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('feusersplus') . 'Resources/Public/Icons/tx_feusersplus_domain_model_hut.gif'
],
'interface' => [
'showRecordFieldList' => 'uid_local,uid_foreign'
],
'types' => [
'1' => ['showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource;;1, uid_local, uid_foreign,--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access'],
],
'palettes' => [
'1' => ['showitem' => ''],
],
'columns' => [
'sys_language_uid' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [
['LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1],
['LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0]
],
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'items' => [
['', 0],
],
'foreign_table' => 'tx_fefiles_domain_model_photo',
'foreign_table_where' => 'AND tx_fefiles_domain_model_photo.pid=###CURRENT_PID### AND tx_fefiles_domain_model_photo.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
]
],
'uid_local' => [
'exclude' => 1,
'label' => 'LLL:EXT:feusersplus/Resources/Private/Language/locallang_db.xlf:user',
'config' => [
'type' => 'select',
'foreign_table' => 'fe_users',
'minitems' => 1,
'maxitems' => 1,
]
],
'uid_foreign' => [
'exclude' => 1,
'label' => 'LLL:EXT:feusersplus/Resources/Private/Language/locallang_db.xlf:smile',
'config' => [
'type' => 'select',
'foreign_table' => 'tx_feusersplus_domain_model_service',
// 'foreign_field' => 'uid',
// 'foreign_table_where' => 'AND tx_feusersplus_domain_model_service.sys_language_uid=###REC_FIELD_sys_language_uid### ',
'foreign_match_fields' => [
'type' => 1
],
'minitems' => 1,
'maxitems' => 1,
]
],
'crdate' => array(
'exclude' => 0,
'label' => 'LLL:EXT:feusersplus/Resources/Private/Language/locallang_db.xlf:crdate',
'config' => array(
'type' => 'input',
'size' => 10,
'max' => 20,
'eval' => 'date',
'checkbox' => '0',
'default' => ''
)
),
],
];
By the way, I use this table for MM relation.
You need to initialize every object storage in your model by:
public function __construct()
{
$this->smile = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}

Extbase: configure controller and action in realURL for detail

I'm going nuts with realURL and extbase.
Is there a simple solution for a list/detail extension to display URLs that are at least orderly, maybe in the form of
/show/detail/title-of-the-item
"show" and "detail" being action and controller, e.g.
I've been trying to remove controller and action, for example as suggested in RealURL: Remove Controller and Action from URL - but there's always something not working. Crazy.
It's not even removing the cHash.
My realurl_conf at the moment is:
<?php
$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['_DEFAULT'] = getRealURL('1');
function getRealURL($root)
{
return array(
'init' => array(
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableCHashCache' => 1,
'enableUrlEncodeCache' => 1,
'respectSimulateStaticURLs' => 0,
'postVarSet_failureMode'=>'redirect_goodUpperDir',
),
'redirects_regex' => array (
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'fr' => '1',
),
'valueDefault' => 'de',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 7,
'rootpage_id' => 1,
),
'postVarSets' => array(
'_DEFAULT' => array(
'wb' => array(
array(
'GETvar' => 'tx_weiterbildung_pi1[item]' ,
'lookUpTable' => array(
'table' => 'tx_weiterbildung_domain_model_item',
'id_field' => 'uid',
'alias_field' => 'kurs_titel',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
),
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev'=>0,
'index' => array(
'rss.xml' => array(
'keyValues' => array(
'type' => 100,
),
),
'rss091.xml' => array(
'keyValues' => array(
'type' => 101,
),
),
'rdf.xml' => array(
'keyValues' => array(
'type' => 102,
),
),
'atom.xml' => array(
'keyValues' => array(
'type' => 103,
),
),
),
),
);
}
/**********************************
REALURL end
***********************************/
?>
Not quite simple, but at least working...
In EVERY of my ext I DO NOT use f:link.action VH, instead f:link.page so you can genearte links like
?id=123&tx_yourext_foo=bar
Without controller and action params, of course as you can see most probably you'll need to modify your FE plugins, to read these params with GeneralUtility::_GP('tx_yourext_foo'), especially if this plugin uses more than on mode (action) depending on params

zf2 form collection don't show element description

When the collection element is rendered , description element does not appear.
ZF2 seems to ignore the description option in the form collection.
Form
$this->add(array(
'type' => 'Zend\Form\Element\Collection',
'name' => 'value',
'options' => array(
'label' => 'Please choose value',
'count' => 1,
'should_create_template' => true,
'target_element' => new ValueFieldset($objectManager)
)
));
Form Fieldset: ValueFieldset
$this->add(array(
'name' => 'name',
'type' => 'Zend\Form\Element\Text',
'options' => array(
'label' => 'Values',
'label_attributes' => array(
'class' => 'form-label'
),
'description' => 'X',
'multiple' => true,
),
)
);
View
echo $this->formCollection($values);