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

Quote marks stripped #48

Closed
gglnx opened this issue Apr 5, 2023 · 7 comments
Closed

Quote marks stripped #48

gglnx opened this issue Apr 5, 2023 · 7 comments

Comments

@gglnx
Copy link

gglnx commented Apr 5, 2023

Describe the bug

Quote marks like „“« (but not ») getting stripped from plain text and Redactor fields inside Hyper fields on saving.

Steps to reproduce

  1. Create plain text field and Redactor field
  2. Create a Hyper field with the fields above
  3. Try to save fields with „“»« inside

Craft CMS version

4.4.6.1

Plugin version

1.1.3

Multi-site?

No response

Additional context

No response

@engram-design
Copy link
Member

Looks like LitEmoji is treating those as emoji's and stripping them out. Should be fixed for the next release. To get this early run composer require verbb/hyper:"dev-craft-4 as 1.1.3"

@gglnx
Copy link
Author

gglnx commented Apr 6, 2023

Now I get an JSON encoding error on saving:

yii\base\InvalidArgumentException: Syntax error in vendor/yiisoft/yii2/helpers/BaseJson.php:147
Stack trace:
#0 vendor/yiisoft/yii2/helpers/BaseJson.php(128): yii\helpers\BaseJson::handleJsonError(4)
#1 vendor/verbb/hyper/src/fields/HyperField.php(242): yii\helpers\BaseJson::decode('[{"type":"verbb...')
#2 vendor/craftcms/cms/src/base/Element.php(2456): verbb\hyper\fields\HyperField->serializeValue('[{"type":"verbb...', Object(craft\elements\MatrixBlock))
#3 vendor/yiisoft/yii2/base/Model.php(370): craft\base\Element->afterValidate()
#4 vendor/craftcms/cms/src/base/Element.php(2411): yii\base\Model->validate(Array, true)
#5 vendor/craftcms/cms/src/fields/Matrix.php(803): craft\base\Element->validate()
#6 vendor/craftcms/cms/src/base/Element.php(2549): craft\fields\Matrix->validateBlocks(Object(craft\elements\Entry), NULL)
#7 vendor/yiisoft/yii2/validators/InlineValidator.php(77): craft\base\Element->validateCustomFieldAttribute('field:blocks', Array, Object(yii\validators\InlineValidator), Object(craft\elements\db\MatrixBlockQuery))
#8 vendor/yiisoft/yii2/validators/Validator.php(260): yii\validators\InlineValidator->validateAttribute(Object(craft\elements\Entry), 'field:blocks')
#9 vendor/craftcms/cms/src/base/Element.php(2450): yii\validators\Validator->validateAttributes(Object(craft\elements\Entry))
#10 vendor/yiisoft/yii2/base/Model.php(370): craft\base\Element->afterValidate()
#11 vendor/craftcms/cms/src/base/Element.php(2411): yii\base\Model->validate(Array, true)
#12 vendor/craftcms/cms/src/services/Elements.php(2969): craft\base\Element->validate()
#13 vendor/craftcms/cms/src/services/Elements.php(1063): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, false, NULL, Array, false)
#14 vendor/craftcms/cms/src/controllers/ElementsController.php(1339): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#15 [internal function]: craft\controllers\ElementsController->actionApplyDraft()
#16 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#17 vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#18 vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('apply-draft', Array)
#19 vendor/craftcms/cms/src/web/Application.php(302): yii\base\Module->runAction('elements/apply-...', Array)
#20 vendor/craftcms/cms/src/web/Application.php(627): craft\web\Application->runAction('elements/apply-...', Array)
#21 vendor/craftcms/cms/src/web/Application.php(281): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#22 vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#23 web/index.php(14): yii\base\Application->run()
#24 {main}

@gglnx
Copy link
Author

gglnx commented Apr 6, 2023

It happens now then the fields contains a " (double quote mark)

@gglnx
Copy link
Author

gglnx commented Apr 6, 2023

Also slashes now get escaped on saving. Sorry :(

@engram-design
Copy link
Member

engram-design commented Apr 6, 2023

Aha, looks like Brandon beat me to it and is an issue for Craft itself elvanto/litemoji#36 (comment) and craftcms/cms#12905

Just pushed a fix again.

@gglnx
Copy link
Author

gglnx commented Apr 6, 2023

Perfect, works!

@engram-design
Copy link
Member

Updated in 1.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants