You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you very much for creating this extension.
I used recently the yii2-comments with a shared host from Bluehost and I was receiving a 405 error during the creation of a new comment.
I figured out that was something related to the crypted/serialized json message that was being corrupted somehow during the form submission. I also noticed that the serialized data was already encoded in utf8. But the issue continued.
To solve this issue, I had to use the base64_encode, such as next:
File: yii2-comments/widgets/Comment.php -> line 18
From:
'action' => Url::to(['/comment/default/create', 'entity' => $encryptedEntity]),
To:
'action' => Url::to(['/comment/default/create', 'entity' => base64_encode($encryptedEntity)]),
File: yii2-comments/controllers/DefaultController.php -> line 110
From:
$commentModel->setAttributes($this->getCommentAttributesFromEntity($entity));
To:
$commentModel->setAttributes($this->getCommentAttributesFromEntity(base64_decode($entity)));
This solved the issue.
Thank you very much.
Cheers.
The text was updated successfully, but these errors were encountered:
Hi,
First of all, thank you very much for creating this extension.
I used recently the yii2-comments with a shared host from Bluehost and I was receiving a 405 error during the creation of a new comment.
I figured out that was something related to the crypted/serialized json message that was being corrupted somehow during the form submission. I also noticed that the serialized data was already encoded in utf8. But the issue continued.
To solve this issue, I had to use the base64_encode, such as next:
File: yii2-comments/widgets/Comment.php -> line 18
From:
'action' => Url::to(['/comment/default/create', 'entity' => $encryptedEntity]),
To:
'action' => Url::to(['/comment/default/create', 'entity' => base64_encode($encryptedEntity)]),
File: yii2-comments/controllers/DefaultController.php -> line 110
From:
$commentModel->setAttributes($this->getCommentAttributesFromEntity($entity));
To:
$commentModel->setAttributes($this->getCommentAttributesFromEntity(base64_decode($entity)));
This solved the issue.
Thank you very much.
Cheers.
The text was updated successfully, but these errors were encountered: