givanz / Vvveb

Powerful and easy to use cms to build websites, blogs or ecommerce stores.
https://www.vvveb.com
GNU Affero General Public License v3.0
384 stars 82 forks source link

Fatal error encountered when sending a "Forgot Password" email #183

Open siddhantprateek opened 3 months ago

siddhantprateek commented 3 months ago

I'm using the vvveb Docker image, and when the application is running, I encounter an error while trying to send a "Forgot Password" email.

Steps to Reproduce:

  1. Run the vvveb application using the Docker image.
  2. Navigate to the "Forgot Password" page.
  3. Attempt to send a password reset email.
  4. Observe the error.

Error Message:

Fatal error: Cannot use isset() on the result of an expression 
(you can use "null !== expression" instead) 
in /var/www/vvveb/storage/compiled-templates/admin_1_default_email_user_reset.html on line 330

Expected Behavior:

The password reset email should be sent successfully without any errors.

Actual Behavior:

A fatal error occurs, preventing the email from being sent.


The temporary fix that i'm doing is, updating compiled-templates/admin_1_default_email_user_reset.html by replacing

<span data-v-site-description-title><?php if (isset($this->site-description-title)) echo htmlentities($this->site-description-title); ?></span>

to

<span data-v-site-description-title><?php if (isset($this->{"site-description-title"})) { echo htmlentities($this->{"site-description-title"}); } ?></span>

<span data-v-site-address><?php if (isset($this->site-address)) echo htmlentities($this->site-address); ?></span>

to

<span data-v-site-address><?php if (isset($this->{"site-address"})) { echo htmlentities($this->{"site-address"}); } ?></span>
givanz commented 3 months ago

Thank you for the bug report, it's fixed in the latest.zip update.

The site component was not included in the reset.html email template.

siddhantprateek commented 3 months ago

image

i don't think its fixed yet, i ran into this issue

givanz commented 3 months ago

I thinks this is related to missing site title/description.

siddhantprateek commented 3 months ago

Thanks for the help! 🙂 The issue is resolved after making that addition, but I'll be in trouble if I self-host it, and haven't set any language or title in my initial login.

givanz commented 3 months ago

Can you please provide more details on how to reproduce this bug and avoid setting the website title?

Default language and site title is required at install.

install

siddhantprateek commented 3 months ago

This is how you can reproduce it:

After completing the initial setup (where I add the primary language and website name), the issue appears when I try to reset the password on my next visit if I haven't set the localization language and site title.

givanz commented 3 months ago

when I try to reset the password on my next visit if I haven't set the localization language and site title.

Language and site tile set on install will remain unless they are changed from admin, you don't need to set them again after admin login.

I tried to reset admin password right after install and I don't get any php error, I also tried to login and logout and then reset again.

Is there an additional step that I should do before password reset to generate the error?

Tried with a new docker image.