#18423·yii2

[yii.ActiveForm] errorSummaryCssClass - bug

Author: youra-hCreated Dec 6, 2020Updated May 28, 2026
Labelstype:bugJS

What steps will reproduce the problem?

Hello! In ActiveForm I don't use $errorSummaryCssClass, so I put "" or false. But then an error occurs, because:

php
protected function getClientOptions()
    {
        $options = [
            'encodeErrorSummary' => $this->encodeErrorSummary,
            'errorSummary' => '.' . implode('.', preg_split('/\s+/', $this->errorSummaryCssClass, -1, PREG_SPLIT_NO_EMPTY)),
            'validateOnSubmit' => $this->validateOnSubmit,
            'errorCssClass' => $this->errorCssClass,
            'successCssClass' => $this->successCssClass,
            'validatingCssClass' => $this->validatingCssClass,
            'ajaxParam' => $this->ajaxParam,
            'ajaxDataType' => $this->ajaxDataType,
            'scrollToError' => $this->scrollToError,
            'scrollToErrorOffset' => $this->scrollToErrorOffset,
            'validationStateOn' => $this->validationStateOn,
        ];

errorSummary = '.' When you click Submit, an error occurs in yii.ActiveForm on line 863.

javascript
var updateSummary = function ($form, messages) {
        var data = $form.data('yiiActiveForm'),
            $summary = $form.find(data.settings.errorSummary),

data.settings.errorSummary = '.' jquery.js:1677 Uncaught Error: Syntax error, unrecognized expression: .

What is the expected result?

What do you get instead?

Additional info

Q A
Yii version 2.0.
PHP version 7
Operating system Windows