femanager icon indicating copy to clipboard operation
femanager copied to clipboard

Image Upload on createAction doesn't work

Open parzerphilipp opened this issue 11 months ago • 2 comments

$this->processUploadedImage($user); is only executed in createAllConfirmed() but not in createRequest()

just add $this->processUploadedImage($user); here: https://github.com/in2code-de/femanager/blob/v8/Classes/Controller/NewController.php#L370

Probably also missing here: https://github.com/in2code-de/femanager/blob/v8/Classes/Controller/InvitationController.php#L105

parzerphilipp avatar Feb 18 '25 07:02 parzerphilipp

Thanks for the hint — you’re absolutely right that $this->processUploadedImage($user) is only called in createAllConfirmed() and not in createRequest().

However, simply adding it at NewController.php#L370

is not enough, because at that point the user has not yet been persisted and therefore has no UID.

Without a UID, the image upload will fail silently, since the sys_file_reference requires a valid uid_foreign to fe_users.uid.

Working solution (tested on TYPO3 12.4.37 / femanager 8.3.2):

Add the upload handling $this->processUploadedImage($user); after the user has been persisted in createRequest() — right after https://github.com/in2code-de/femanager/blob/16ac98abe713fc830091bb59a811c9490ebe4051/Classes/Controller/NewController.php#L413

This ensures the image is uploaded immediately when the user registers, even if confirmByUser or confirmByAdmin is active.

ps-devstudio avatar Oct 09 '25 09:10 ps-devstudio

internal dev ticket https://projekte.in2code.de/issues/75334

sbusemann avatar Oct 14 '25 09:10 sbusemann