Review main Abandoned

72006[TASK] Read all fields in UserAspect

Guido Schmechel CR 0 V 0 Easy +25 −0 updated 02/04/23, 10:43

Commit message

UserAspect is currently limited to certain field names
within its API. Now the getter is extended by a DefaultCase
which returns the content of the field 1:1.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1620

  1. Guido Schmechel uploaded patch set 1 10/30/21, 10:18

  2. core-ci voted on patch set 1 V +1 10/30/21, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18665

  3. Guido Schmechel commented on patch set 1 10/30/21, 10:43

    To discuss: 1.) Is this something for TYPO3 v10/v11? Actually more a feature than a task 2.) Content of the commit message 3.) Where would the documentation have to be adapted afterwards except on https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Context/Index.html#user-aspect
  4. Stefan Bürk commented on patch set 1 10/30/21, 19:05

    UserAspect.php:93

    Would suggest to use array_key_exists here. isset() returns false if array key exists but value is "null", leading to exception for that case. This would "fail" what was intended to do with this patch.
  5. Guido Schmechel uploaded patch set 2 10/31/21, 10:44

  6. Guido Schmechel commented on patch set 2 10/31/21, 10:45

    UserAspect.php:93 Reply

    Thx for the hint! I have adopted the solution from https://www.php.net/manual/de/function.array-key-exists.php#107786 I think that makes sense.
  7. core-ci voted on patch set 2 V -1 10/31/21, 11:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18697

  8. Guido Schmechel uploaded patch set 3 10/31/21, 11:22

  9. core-ci voted on patch set 3 V +1 10/31/21, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18698

  10. Andreas Kienast commented on patch set 3 11/01/21, 10:27

    A soft -1 from my side: I'm not sure about 10.4, also I'd like to have an approval by Benni here.
  11. Benni Mack commented on patch set 3 11/01/21, 12:09

    This way, you could fetch e.g. the password field or the "uc" field from the user. Do we want this?
  12. Guido Schmechel commented on patch set 3 11/01/21, 12:15

    Reply

    No, not really ;-) Of course, we could still define a blocklist for certain fields in this class. The basic question remains: 1.) Do we have a solution for v10/v11 that is simple? 2.) For v12, an event would certainly be more interesting, where I could hook into the API. Then everyone can register something themselves
  13. Guido Schmechel commented on patch set 3 V -1 11/01/21, 12:16

    UserAspect.php:93 Reply

    Done
  14. Benni Mack commented on patch set 3 11/11/21, 14:41

    Reply

    I'm usually in favor of having a "allow list" than an "exclude list".
  15. Guido Schmechel commented on patch set 3 11/11/21, 16:31

    Reply Unresolved

    Then there should also be a possibility for the programmer to define/overwrite this somewhere. That almost brings us back to the event :-D If we can't create a small solution for v10/v11, which would be ok, then let's go directly to v12 and solve this via that. What do you say to that?
  16. Benni Mack wrote 11/29/21, 10:14

    Change destination moved from master to main
  17. Benni Mack updated the commit message in patch set 4 11/29/21, 13:38

  18. core-ci voted on patch set 4 V +1 11/29/21, 15:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20066

  19. Christian Kuhn commented on patch set 4 02/04/23, 10:42

    Hey. Here is the thing: The user objects (AbstractUserAuthentication, BackendUserAuthentication, ...) are pretty messy. They need a bigger overhaul and need to continue separating the user data fields from the functionality within the classes. The public property '$user' has been marked @internal for this reason. At the moment, we do not want to extend this context aspect to allow accessing "everything", since this would again surface the user properties and make them API again, which increases problems when we continue to clean up UserAuthentication classes. As such, it would probably be fine to add the one or the other specific detail, but not a general "surface everything". I hope it's ok to abandon here for this reason.
  20. Christian Kuhn abandoned the change 02/04/23, 10:43