Review main Abandoned

29761[TASK] FrontendUser/FrontendUserGroup: get/set for tx_extbase_type

Stefan Neufeind CR 0 V 0 Normal +52 −0 updated 05/02/14, 14:55

Commit message

Add missing getter/setter for tx_extbase_type.
Names: getTxExtbaseType() and setTxExtbaseType()

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 13

  1. Mr. Jenkins commented on patch set 1 05/01/14, 16:27

  2. Marc Bastian Heinrichs wrote 05/01/14, 18:13

    Topic set to "Extbase".
  3. Marc Bastian Heinrichs commented on patch set 1 CR -1 05/01/14, 18:15

    The tx_extbase_type is only still there for backwards compability. If you want use STI for users, you should implement it on your own.
  4. Stefan Neufeind commented on patch set 1 05/01/14, 18:22

    I don't use it for STI, but extension_builder uses it for backend-magic at the moment. *sigh*
  5. Anja Leichsenring commented on patch set 1 CR -1 05/02/14, 10:05

    no way, have the extension_builder not misuse the field. It is only needed and to be used for STI.
  6. Nico de Haen commented on patch set 1 05/02/14, 10:15

    @Stefan Neufeind: what kind of magic do you mean?
  7. Stefan Neufeind commented on patch set 1 05/02/14, 10:21

    @Nico: When an existing table like a FrontendUser is extended, the additional fields are only shown if the matching tx_extbase_type is chosen. "Some" kind of selector maybe makes sense, so in case you have two separate derived classes it's clear which type of FE-user this would be. But as discussed previously the others seem to regard this as "misuse" of tx_extbase_type - and it's a legacy-field anyway. Maybe we should discuss that inside extension_builder again then. @all: I just thought that since the field is present (not yet dropped) it might make sense to be able to read and update it from inside Extbase. If this doesn't find approval, that's "okay".
  8. Nico de Haen commented on patch set 1 05/02/14, 12:15

    If you extend a model like FrontendUser with the ExtensionBuilder that is done with STI. The only way to handle STI in Extbase is defining a type field and store the record type in it. That's how it came to the field tx_extbase_type when the FrontendUser model was introduced. The fact that this kind of STI should not be used in Core (and thus the tx_extbase_type field being obsolete) does not mean that we can't use STI in the ExtensionBuilder. This are 2 different topics. The ExtensionBuilder does not rely on some type field being present (if not the type field is created when it comes to STI) So there is no ExtensionBuilder specific magic but just a configuration according to the Extbase requirements. Imho the getter/setter for the extbaseType make no sense, since it would mean to convert a Class on runtime just by calling setExtbaseType(). If you need to get the extbaseType of a model you could call instanceof
  9. Stefan Neufeind commented on patch set 1 05/02/14, 12:23

    In my case EXT:femanager creates a new user. And by default tx_extbase_type is not set. Since there is no setter it can't be set to some initial value. Workaround for the moment is that femanager now added a setter to their class. It's not just about changing the type of an already loaded object/user (would not work) but also just editing existing records in the DB (for the text time they are being used somewhere).
  10. Nico de Haen commented on patch set 1 05/02/14, 12:29

    To create a new user you would have to instantiate some class and the class depends on the "extbase type". So on what kind of class would you call setExtbaseType?
  11. Christian Kuhn voted on patch set 1 CR -2 05/02/14, 13:57

  12. Christian Kuhn voted on patch set 1 CR -1 05/02/14, 13:57

  13. Stefan Neufeind abandoned the change 05/02/14, 14:55

    Discussed this in depth with Nico (thanks a lot). We found various ways to circumvent this or that problem of being able to inherit only once. But all have other details-problems imho. I'll therefor abandon this suggestion here, but would be happy to discuss the matter further with anybody who would like to :-)