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
When filling the field with a large amount of data CraftCMS returns TypeError: Argument 1 passed to craft\helpers\Html::_namespaceInputs() must be of the type string, null given, called in /app/vendor/craftcms/cms/src/helpers/Html.php on line 601
With the help of Xdebug I found out that the problem is $html variable stored as null. Null value returns because of PREG_BACKTRACK_LIMIT_ERROR inside preg_replace_callback(). pcre.backtrack_limit is "1000000" by default.
I know that storing such a large amount of text is not a good idea, but I think that such an error should be handled in Craft to avoid customer problems.
I haven't tested it with Craft 4 yet, but looking through source I see the same issue as well.
Steps to reproduce
Create a custom textarea field up to 16mb size limit
Attach it to some section and fill this input in the entry. There should be more then 1 million chars in the field
Try open / refresh entry in CP again
Expected behavior
CP should not throw an Exception but show an error or notification maybe? I still don't know the best way to to avoid this behavior.
Actual behavior
Internal Server error
Craft CMS version
3.8.5
PHP version
7.2.34
Operating system and version
Linux 5.15.90.1-microsoft-standard-WSL2
Database type and version
MySQL 5.7.40
Image driver and version
Imagick 3.4.4 (ImageMagick 7.0.10-48)
Installed plugins and versions
Blitz | 3.12.8
Blitz Recommendations | 1.3.0
Blitz | 3.12.8
Blitz Recommendations | 1.3.0
CP Field Inspect | 1.4.4
Groupie | 1.0.8
Incognito Field | 1.3.0
Minifier | 3.0.0
Password Policy | 1.2.0
Position Fieldtype | 1.0.17
Protected Links | 0.0.4
Redactor | 2.10.12
Sentry Logger | 1.3.1
SEOmatic | 3.4.51
SessionSync | 0.0.1
Splash | 3.0.5
Store Hours | 2.2.0
Super Table | 2.7.4
Typed link field | 1.0.25
The text was updated successfully, but these errors were encountered:
What happened?
Description
When filling the field with a large amount of data CraftCMS returns TypeError: Argument 1 passed to craft\helpers\Html::_namespaceInputs() must be of the type string, null given, called in /app/vendor/craftcms/cms/src/helpers/Html.php on line 601
With the help of Xdebug I found out that the problem is
$html
variable stored asnull
. Null value returns because ofPREG_BACKTRACK_LIMIT_ERROR
inside preg_replace_callback(). pcre.backtrack_limit is "1000000" by default.https://github.com/craftcms/cms/blob/develop/src/helpers/Html.php#L854
I know that storing such a large amount of text is not a good idea, but I think that such an error should be handled in Craft to avoid customer problems.
I haven't tested it with Craft 4 yet, but looking through source I see the same issue as well.
Steps to reproduce
Expected behavior
CP should not throw an Exception but show an error or notification maybe? I still don't know the best way to to avoid this behavior.
Actual behavior
Internal Server error
Craft CMS version
3.8.5
PHP version
7.2.34
Operating system and version
Linux 5.15.90.1-microsoft-standard-WSL2
Database type and version
MySQL 5.7.40
Image driver and version
Imagick 3.4.4 (ImageMagick 7.0.10-48)
Installed plugins and versions
Blitz | 3.12.8
Blitz Recommendations | 1.3.0
Blitz | 3.12.8
Blitz Recommendations | 1.3.0
CP Field Inspect | 1.4.4
Groupie | 1.0.8
Incognito Field | 1.3.0
Minifier | 3.0.0
Password Policy | 1.2.0
Position Fieldtype | 1.0.17
Protected Links | 0.0.4
Redactor | 2.10.12
Sentry Logger | 1.3.1
SEOmatic | 3.4.51
SessionSync | 0.0.1
Splash | 3.0.5
Store Hours | 2.2.0
Super Table | 2.7.4
Typed link field | 1.0.25
The text was updated successfully, but these errors were encountered: