Skip to content
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

Feature Request: More than one attachment possible? #11

Open
ineswillenbrock opened this issue Feb 6, 2023 · 3 comments
Open

Feature Request: More than one attachment possible? #11

ineswillenbrock opened this issue Feb 6, 2023 · 3 comments

Comments

@ineswillenbrock
Copy link
Collaborator

ineswillenbrock commented Feb 6, 2023

Hi there,

I'm on TYPO3 11.5 with PHP 7.4 and Jobfair 4.0.4, legacy install. (was TYPO3 10.4, behaves the same)

I'm able to configure jobfair to accept more than one Upload, but I can't figure out, how to attach more than one file to the mails.

I configured it to have 4 attachments called attachement, attachement2, attachement3 and attachment4 and can access those in the Backend, but when I try to send an application via the frontend, it failes when trying to attache the files to the mail(s).

I get this error:

(1/1) Error

Call to a member function getOriginalResource() on null
in /var/www/localhost/htdocs/t3-11/typo3conf/ext/jobfair/Classes/Controller/JobController.php line 656

            $recipientsBcc,
            $sender,
            LocalizationUtility::translate('tx_jobfair_domain_model_application.email_subject', 'jobfair', ['jobTitle' => $job->getJobTitle()]),
            ['newApplication' => $newApplication, 'job' => $job],
            $newApplication->getAttachment()->getOriginalResource()->getName()
        )) {
            $this->flashMessageService('applicationSendMessage', 'applicationSendStatus', 'OK');
        } else {
            $this->flashMessageService('applicationSendMessageGeneralError', 'applicationSendStatusGeneralErrorStatus', 'ERROR');

at Dan\Jobfair\Controller\JobController->createApplicationAction()
in /var/www/localhost/htdocs/typo3_src-11.5.21/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php line 575

        }
        $validationResult = $this->arguments->validate();
        if (!$validationResult->hasErrors()) {
            $this->eventDispatcher->dispatch(new BeforeActionCallEvent(static::class, $this->actionMethodName, $preparedArguments));
            $actionResult = $this->{$this->actionMethodName}(...$preparedArguments);
        } else {
            $actionResult = $this->{$this->errorMethodName}();
        }

Any idea, how to fix it?
Or should I save my time and use just the one attachment thats there?

edit: TYPO3 Version

@ineswillenbrock
Copy link
Collaborator Author

Seems, that it's a general problem with applications without attachments, not just my idea of adding more than one.
If I wrap the "create mail"- part of createApplicationAction() with a check, if there is an attachment, it works for me.
Do you want a pull request?

@nhovratov
Copy link
Owner

Hey, thanks for investigating and coming back with a fix. Sure, make a PR so I can release a new version for this. Thanks!

@ineswillenbrock
Copy link
Collaborator Author

Will do, when I find a solution, that's a bit less brutal

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

No branches or pull requests

2 participants