Project

General

Profile

Actions

Bug #18233

closed

error when using a IRRE twice in a record

Added by Stefano Cecere almost 17 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-02-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

here is the problem:

i have a basic "attachment" table, which i use to define file attachments to different kind of records.

i have a main record which has IRRE relation to the attachments table, and has another IRRE relation with a subtable which uses attachments as well.

the second table using IRRE to the attachment table can' read some of the tables fields (returning empty fields when they are filled in the db) and give the yellow exclamation alert because it thinks they are empty.

i could not find JS errors or anything else to help bugfixing this odd behaviours...

(issue imported from #M7563)

Actions #1

Updated by Oliver Hader over 16 years ago

Please post the relevant parts of your tca.php file here. What is the whole structure and how are these fields of type 'inline' nested there?
If you're using two IRRE fields on the same parent table to the same child table, this won't work (see #17434 for details).

Actions #2

Updated by Stefano Cecere over 16 years ago

here is the relevant part of the TCA

as you can see "tx_gv_allegati" is a common attachment record that i use in many other records.
both tx_gv_edifici and tx_gv_piani have it
the problem is that tx_gv_allegati has tx_gv_piani ... there come big errors in the IRRE management!

$TCA['tx_gv_edifici'] = array (
'ctrl' => $TCA['tx_gv_edifici']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'hidden,titolo_edificio,uid_iniziativa,codice_edificio,descrizione_edificio,data_consegna_edificio,immagini_edificio,allegati_edificio'
),
'feInterface' => $TCA['tx_gv_edifici']['feInterface'],
'columns' => array (
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'uid_iniziativa' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.uid_iniziativa',
'config' => Array (
'type' => 'select',
'foreign_table' => 'tx_gv_iniziative',
'foreign_table_where' => ' ORDER BY tx_gv_iniziative.uid',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'titolo_edificio' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.titolo_edificio',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'required',
)
),
'codice_edificio' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.codice_edificio',
'config' => Array (
'type' => 'input',
'size' => '20',
'eval' => 'required,trim',
)
),
'descrizione_edificio' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.descrizione_edificio',
'config' => Array (
'type' => 'text',
'cols' => '30',
'rows' => '5',
)
),
'data_consegna_edificio' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.data_consegna_edificio',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'trim',
)
),
'note_edificio' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv.note',
'config' => Array (
'type' => 'text',
'cols' => '50',
'rows' => '5',
)
),
'immagini_edificio' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.immagini_edificio',
'config' => Array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => 500,
'uploadfolder' => 'uploads/tx_gv/immagini',
'show_thumbs' => 1,
'size' => 5,
'minitems' => 0,
'maxitems' => 10,
)
),
'allegati_edificio' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_edifici.allegati_edificio',
'config' => Array (
'type' => 'inline',
'foreign_table' => 'tx_gv_allegati',
'foreign_field' => 'uid_parente',
'foreign_table_field' => 'table_parente',
'maxitems' => 10,
)
),
'piani' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_scale.piani',
'config' => Array (
'type' => 'inline',
'foreign_table' => 'tx_gv_piani',
'foreign_field' => 'uid_edificio',
'maxitems' => 20,
)
),
),
'types' => array (
'0' => array('showitem' => 'hidden;;1;;1-1-1, titolo_edificio, uid_iniziativa, codice_edificio, data_consegna_edificio, descrizione_edificio;;;richtext[cut|copy|paste|formatblock|textcolor|bold|italic|underline|left|center|right|orderedlist|unorderedlist|outdent|indent|link|table|image|line|chMode]:rte_transform[mode=ts_css|imgpath=uploads/tx_gv/rte/],immagini_edificio,note_edificio, --div--;Piani, piani,--div--;Scale, scale,--div--;Allegati,allegati_edificio')
),
'palettes' => array (
'1' => array('showitem' => '')
)
);

$TCA['tx_gv_piani'] = array (
'ctrl' => $TCA['tx_gv_piani']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'hidden,uid_scala,ordinale_su_scala,titolo_piano'
),
'feInterface' => $TCA['tx_gv_piani']['feInterface'],
'columns' => array (
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'uid_edificio' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_scale.uid_edificio',
'config' => Array (
'type' => 'select',
'foreign_table' => 'tx_gv_edifici',
'foreign_table_where' => 'AND tx_gv_edifici.pid=###CURRENT_PID### ORDER BY tx_gv_edifici.uid',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'ordinale_su_scala' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_piani.ordinale_su_scala',
'config' => Array (
'type' => 'input',
'size' => '5',
'max' => '4',
'eval' => 'required,int',
)
),
'titolo_piano' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_piani.titolo_piano',
'config' => Array (
'type' => 'input',
'size' => '5',
'eval' => 'required,trim',
)
),
'allegati_piano' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv.allegati',
'config' => Array (
'type' => 'inline',
'foreign_table' => 'tx_gv_allegati',
'foreign_field' => 'uid_parente',
'maxitems' => 10,
)
),
),
'types' => array (
'0' => array('showitem' => 'hidden;;1;;1-1-1, uid_edificio, ordinale_su_scala, titolo_piano, allegati_piano')
),
'palettes' => array (
'1' => array('showitem' => '')
)
);

$TCA['tx_gv_allegati'] = array (
'ctrl' => $TCA['tx_gv_allegati']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'hidden,titolo_allegato,file_allegato'
),
'feInterface' => $TCA['tx_gv_allegati']['feInterface'],
'columns' => array (
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'uid_parente' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_allegati.uid_parente',
'config' => Array (
'type' => 'passthrough',
)
),
'table_parente' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_allegati.table_parente',
'config' => Array (
'type' => 'passthrough',
)
),
'titolo_allegato' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_allegati.titolo_allegato',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'required,trim',
)
),
'file_allegato' => Array (
'exclude' => 0,
'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv_allegati.file_allegato',
'config' => Array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => '',
'disallowed' => 'php,php3',
'max_size' => 5000,
'uploadfolder' => 'uploads/tx_gv/allegati',
'show_thumbs' => 1,
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
),
'types' => array (
'0' => array('showitem' => 'hidden;;1;;1-1-1, titolo_allegato, file_allegato')
),
'palettes' => array (
'1' => array('showitem' => '')
)
);

Actions #3

Updated by Oliver Hader over 16 years ago

I did not test it, but in your tca.php the 'foreign_table_field' property is missing for tx_gv_piani.allegati_piano.

Changing your configuration to the following should work:

'allegati_piano' => Array (
  'exclude' => 1,
    'label' => 'LLL:EXT:gv/locallang_db.xml:tx_gv.allegati',
    'config' => Array (
    'type' => 'inline',
    'foreign_table' => 'tx_gv_allegati',
    'foreign_field' => 'uid_parente',
    <b>'foreign_table_field' => 'table_parente'</b>
    'maxitems' => 10,
  )
),

Actions #4

Updated by Stefano Cecere over 16 years ago

thank Oliver! it was it!!!!

so foreign_table_field is quite mandatory...

(the TCA manual is not that clear about IRRE configuration.. i know i spent much time on it :(

Actions #5

Updated by Steffen Kamper over 16 years ago

so this bug can be closed?

Actions #6

Updated by Oliver Hader over 16 years ago

No, the fix would be to improve the documentation in doc_core_api and the irre_tutorial.

Actions #7

Updated by Stefano Cecere over 16 years ago

doc_core_api i meant... yes

(i didn't check irre_tutorial .. i think it would be better to improve well doc_core_ap)

yes this bug can be closed, thanks oliver

Actions #8

Updated by Christian Kuhn over 15 years ago

Resolved, no change required as requested by reporter.

Actions #9

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF