8000 WIP: Fix bug on multistep by rintisch · Pull Request #11 · WapplerSystems/form_extended · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WIP: Fix bug on multistep #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: release/v11
Choose a base branch
from

Conversation

rintisch
Copy link
@rintisch rintisch commented Feb 23, 2023

This tries to solve #8

What I did so far:

  • Add a customized UploadResourceViewHelper.
    • Is an adapted version of the original from EXT:form
    • Adapted is the method getUploadedResource()
    • New is addFileInFormFrontend()

This solves the named bug.

BUT

EmailFinisher fails

To make it working also an adaption in https://github.com/TYPO3/typo3/blob/10cbd42b3f67717e842233ddf8a6cb7a9af6af78/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php#L152-L155 is needed. It would need to become something like the following:

if ($file instanceof FileReference) {
    $file = $file->getOriginalResource();
}
if (is_array($file)) {
    foreach ($file as $item) {

        if ($item instanceof FileReference) {
            $item = $item->getOriginalResource();
        }

        $mail->attach($item->getContents(), $item->getName(), $item->getMimeType());
    }
} else {
    $mail->attach($file->getContents(), $file->getName(), $file->getMimeType());
}

Therefore it might be the best to add a new finisher like MultiUploadEmailFinisher which contains this adaption. Has the downside that the editor needs to know that this finisher must be used...

Failing when form is rerendered

Furthermore does it fail if you go back and forth in a multistep form or if a user violates a validator. I do not know how this work at all. Has someone a hint how EXT:form makes this working when using a single file? Does my solution from above break something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0