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

Return value error on template? #211

Open
HeartlandTechie opened this issue Jun 24, 2022 · 6 comments
Open

Return value error on template? #211

HeartlandTechie opened this issue Jun 24, 2022 · 6 comments
Labels
bug Something isn't working Review Needed Suggestion we appreciate your suggestions testing v5 version 5, supports both API and self hosted

Comments

@HeartlandTechie
Copy link

Qoraiche\MailEclipse\MailEclipse::getTemplate(): Return value must be of type ?Illuminate\Support\Collection, none returned

Reproduction steps

Steps to reproduce the behavior:

  1. Go to create template.
  2. Go through steps to create template, name/description - get Axios 500 error . . . assuming it didn't create
  3. Click on template that it thinks was created to edit and get error message.

Laravel Version:

Laravel 9.17.0

PHP
PHP 8.1.6

MailEclipse package version:

source : [git] https://github.com/Qoraiche/laravel-mail-editor.git 085d431

Screenshots (if applicable)

@HeartlandTechie HeartlandTechie added bug Something isn't working Review Needed labels Jun 24, 2022
@ReeceM
Copy link
Collaborator

ReeceM commented Jun 25, 2022

Hi @HeartlandTechie

The version that you have quoted there is the branch number that I committed on this last week and isn't released?

Is this correct?

@ReeceM
Copy link
Collaborator

ReeceM commented Jun 25, 2022

Hi @HeartlandTechie,

I am unable to reproduce this error. Would it be possible to supply a log from the laravel.log file? Also maybe a repository link for a minimal setup to reproduce this error? This would really help :)

@HeartlandTechie
Copy link
Author

Yes, I put in the branch to try to fix the error . . . I get an Axios 500 error when creating a new template, so I suspect it's a permissions issue?

@HeartlandTechie
Copy link
Author

{ "message": "file_put_contents(/var/www/wbl/app/Mail/templates.json): Failed to open stream: Permission denied", "exception": "ErrorException", "file": "/var/www/wbl/vendor/qoraiche/laravel-mail-editor/src/MailEclipse.php", "line": 129, "trace": [ { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php", "line": 257, "function": "handleError", "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions", "type": "->" }, { "function": "Illuminate\\Foundation\\Bootstrap\\{closure}", "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions", "type": "->" }, { "file": "/var/www/wbl/vendor/qoraiche/laravel-mail-editor/src/MailEclipse.php", "line": 129, "function": "file_put_contents" }, { "file": "/var/www/wbl/vendor/qoraiche/laravel-mail-editor/src/MailEclipse.php", "line": 263, "function": "saveTemplates", "class": "Qoraiche\\MailEclipse\\MailEclipse", "type": "::" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php", "line": 337, "function": "createTemplate", "class": "Qoraiche\\MailEclipse\\MailEclipse", "type": "::" }, { "file": "/var/www/wbl/vendor/qoraiche/laravel-mail-editor/src/Http/Controllers/TemplatesController.php", "line": 53, "function": "__callStatic", "class": "Illuminate\\Support\\Facades\\Facade", "type": "::" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Controller.php", "line": 54, "function": "create", "class": "Qoraiche\\MailEclipse\\Http\\Controllers\\TemplatesController", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php", "line": 45, "function": "callAction", "class": "Illuminate\\Routing\\Controller", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 261, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 204, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 725, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 141, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php", "line": 50, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php", "line": 78, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php", "line": 49, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php", "line": 121, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php", "line": 64, "function": "handleStatefulRequest", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php", "line": 37, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php", "line": 67, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 116, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 726, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 703, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 667, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 656, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 167, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 141, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/wbl/vendor/livewire/livewire/src/DisableBrowserCache.php", "line": 19, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Livewire\\DisableBrowserCache", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php", "line": 31, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php", "line": 40, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php", "line": 86, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php", "line": 49, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Http\\Middleware\\HandleCors", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php", "line": 39, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 180, "function": "handle", "class": "Illuminate\\Http\\Middleware\\TrustProxies", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 116, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 142, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/wbl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 111, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/wbl/public/index.php", "line": 52, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" } ] }

@ReeceM
Copy link
Collaborator

ReeceM commented Jun 28, 2022

The error you are getting is a permission issue, I see that it is possibly running on an actual webserver? or is it inside an image?

The package does write to a json file under app/Mail/. Is it possible that you could create that file with read/write permission for that file only?

The other thing is that if you are running this on a server you would need to push / sync changes locally as any git method of deploying will loose changes made on a server

@HeartlandTechie
Copy link
Author

Yes, this is running on a server, I could see how the issues would be with permissions . . any hints that you could add for users like setting the right permissions for editing the file? I haven't dived too far into the code, but I'd wait until the file was written before you update the json file. . . . to avoid weird things like this.

@Qoraiche Qoraiche added Suggestion we appreciate your suggestions testing v5 version 5, supports both API and self hosted labels Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Review Needed Suggestion we appreciate your suggestions testing v5 version 5, supports both API and self hosted
Projects
None yet
Development

No branches or pull requests

3 participants