goalio / GoalioForgotPassword

A Zend Framework 2 (ZF2) Module offering forgot password via e-mail functionality to ZfcUser
BSD 3-Clause "New" or "Revised" License
42 stars 49 forks source link

Zend\Mail\Transport\Factory::create expects an array or Traversable argument; received "NULL" #48

Closed adilogs closed 8 years ago

adilogs commented 8 years ago

I installed everything as per instructions are given on GitHub page. I created a table in my MySQL database. I get the forgot-password page , as soon as I enter email , this error comes out. I have no idea why this error came ?

adilogs commented 8 years ago

The error I am getting is

Zend\Mail\Transport\Exception\InvalidArgumentException

File:
C:\xampp\htdocs\website\vendor\zendframework\zend-mail\src\Transport\Factory.php:42
Message:
Zend\Mail\Transport\Factory::create expects an array or Traversable argument; received "NULL"
pdobrigkeit commented 8 years ago

Did you copy the config file to your autoload directory?

adilogs commented 8 years ago

@pdobrigkeit : Which file we need to copy , is it goaliomailservice.global.php ?

adilogs commented 8 years ago

@pdobrigkeit : I have copied the file goalioforgotpassword.global.php to autoload

pdobrigkeit commented 8 years ago

Which version of ZF are you running? I havn't had a lot of time to update my libraries to the newer versions of ZF... It might have something to do with changes in the Zend\Mail

adilogs commented 8 years ago

Zend Framework 2.5.3

pdobrigkeit commented 8 years ago

Yeah, I am quite sorry, but that might be the reason. I know I am quite lazy in that regard, but only because we are so busy with our own application. I know it is not a good excuse, but I cannot give you a timeline, when I would be able to fix the issues myself. I can only point you in the direction, that you could check how the configuration of the TransportFactory has changed? And my guess it that problem lies in the goalio\mailservice module rather than the forgot password.

adilogs commented 8 years ago

can you send me any link for transport factory for a particular version which was working , so that I change it accordingly and test it ?

pdobrigkeit commented 8 years ago

Our application is running on 2.3.9. I think with the 2.4 release there were some major changes (what my backend-engineer told me) that is why we havn't upgraded yet. So you could try with that version of zf2 and it should work.

adilogs commented 8 years ago

@pdobrigkeit : For going down to 2.3 , I have to degrade lot of dependencies which depend on framework version , that seems too much work for me , rather if you can point me down to the specific file or folder , then I could change it according to latest Zend Framework and then you could add that to your documentation.

pdobrigkeit commented 8 years ago

Could you please post more of the stack trace in of your error? But my guess is that you would need to start in the following file:

GoalioMailService\Mail\Transport\Service\TransportFactory

and check what $options is in your case. If it is null you need to configure the mailservice

2. Copy the configuration files for local and global from
./vendor/goalio/goalio-mailservice/config/goaliomailservice.{local,global}.php.dist` to
./config/autoload/goaliomailservice.{local,global}.php` and change the values as desired.

and configure accordingly to your desired transport and try again.

adilogs commented 8 years ago

Please check http://pastebin.com/AME70T3C for full stack trace

adilogs commented 8 years ago

@pdobrigkeit : After following these steps , it redirects to next page (Screenshot Attached)

image

But it doesn't send any message to the email.

adilogs commented 8 years ago

@pdobrigkeit : Should I use one of the transport options as specified in http://framework.zend.com/manual/current/en/modules/zend.mail.transport.html#zend-mail-transport-quick-start ?

pdobrigkeit commented 8 years ago

The transport is completly up to you, as I cannot know what your setup is. but for startes the SMTP or even Sendmail one should be fine, with the options as well.

adilogs commented 8 years ago

@pdobrigkeit : I tried with SMTP setup , but still it is not working , I have a AWS server , do we need to add additional settings for that ?

adilogs commented 8 years ago

@pdobrigkeit : Even it shows up in my local database(Screenshot attached)

image