Bug #6933

RELATION_HAS_ONE and foreign_field

Added by Peter Niederlag over 3 years ago. Updated 9 months ago.

Status:Rejected Start date:2010-03-20
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Extbase: Generic Persistence
Target version:-
Has patch:No Tags:
Votes: 0

Description

Using a TCA like

'myprop' => array(
  'config'  => array(
    'type' => 'select',
    'foreign_table' => 'tx_eytkey_domain_model_foobar',
    'foreign_field' => 'otherthanuid',
    'maxitems' => 1,
  )
)

I couldn't fetch the attached objects with getMyprop() as expected. .

Cheers,
Peter

datamapper-relationhasone-6933.diff - pacth RELATION_HAS_ONE and foreign_field (1.2 kB) Peter Niederlag, 2010-03-20 18:16

History

Updated by Peter Niederlag over 3 years ago

the attached patch seems to fix the problem

Updated by Peter Niederlag over 3 years ago

the patch probably breaks #6277 again. The Fix needs to handle IRRE as well as regular(stupid) select relations.

Updated by Peter Niederlag almost 3 years ago

This issue is still unsolved.

One of the reasons might be that type=select and type=inline(IRRE) use the config 'foreign_field' in completly different ways. :-< So if inline and select are supported by extbase persistance it needs to handle both approaches appropriatly/different.

All of this is for a VERY SIMPLE n-to-one Relation, using another field than 'uid' for the relation.

select

#TCA.PARENT.COLUMNS#
'myprop' => array(
  'config'  => array(
    'type' => 'select',
    'foreign_table' => 'tx_eytkey_domain_model_foobar',
    'foreign_field' => 'otherthanuid',
    'maxitems' => 1,
  )
)

'PARENT.myprop' will hold the reference to 'tx_eytkey_domain_model_foobar.otherthanuid'
'tx_eytkey_domain_model_foobar.otherthanuid' wont be touched when editing PARENT

This is unsupported.

inline

#TCA.PARENT.COLUMNS#
'myprop' => array(
  'config'  => array(
    'type' => 'inline',
    'foreign_table' => 'tx_eytkey_domain_model_foobar',
    'foreign_field' => 'otherthanuid',
    'maxitems' => 1,
  )
)

'PARENT.myprop' will hold the count (with "maxitems=1" always=1)
'tx_eytkey_domain_model_foobar.otherthanuid' will be updated with "PARENT.uid"

This is supported and works now.

Updated by Peter Niederlag almost 3 years ago

Well, just learned that 'foreign_field' is not supported by 'select', which really puzzles me. It really works quite nice in TYPO3-BE. ;)

Updated by Claus Due almost 2 years ago

  • Has patch set to No

Any news about this one - is it still an issue?

Updated by Michael McManus over 1 year ago

  • Category set to Extbase: Generic Persistence

Updated by Stefan Neufeind over 1 year ago

Peter, please provide a short update.

Updated by Ingo Pfennigstorf 9 months ago

  • Status changed from New to Rejected

See comment #4

Also available in: Atom PDF