Fix the issue in product question creation - #33
Conversation
| @product_question = Spree::ProductQuestion.new(product_question_params) | ||
| @product_question.product = @product | ||
| @product_question.user_id = spree_current_user.id | ||
| @product_question.user_id = spree_current_user&.id |
There was a problem hiding this comment.
we require user to be logged in to create product question right?
why have we implemented this failsafe?
There was a problem hiding this comment.
There is config for the admins to allow or disallow anonymous questions, this was giving issues in case of anonymous being enabled.
Should we just revert this and force only signed in users to create questions?
There was a problem hiding this comment.
I don't think we are asking right question when we are asking:
"Should we just revert this and force only signed in users to create questions?"
It is always better idea to have the configuration to be enabled or disabled..
but as you said, this should be only inserted if the config has allowed to have anonymous review.
should we not insert user id only when anonymouse review is not allowed and raise appropriate error?
No description provided.