mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
@ -7,6 +7,7 @@ Yii Framework 2 elasticsearch extension Change Log
|
||||
- Bug #3587: Fixed an issue with storing empty records (cebe)
|
||||
- Enh #3520: Added `unlinkAll()`-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)
|
||||
- Enh #3527: Added `highlight` property to Query and ActiveRecord. (Borales)
|
||||
- Enh #4086: changedAttributes of afterSave Event now contain old values (dizews)
|
||||
- Enh: Make error messages more readable in HTML output (cebe)
|
||||
- Chg: asArray in ActiveQuery is now equal to using the normal Query. This means, that the output structure has changed and `with` is supported anymore. (cebe)
|
||||
- Chg: Deletion of a record is now also considered successful if the record did not exist. (cebe)
|
||||
|
@ -433,23 +433,23 @@ class Connection extends Component
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to decode error information if it is valid json, return it if not.
|
||||
* @param $body
|
||||
* @return mixed
|
||||
*/
|
||||
protected function decodeErrorBody($body)
|
||||
{
|
||||
try {
|
||||
$decoded = Json::decode($body);
|
||||
if (isset($decoded['error'])) {
|
||||
$decoded['error'] = preg_replace('/\b\w+?Exception\[/', "<span style=\"color: red;\">\\0</span>\n ", $decoded['error']);
|
||||
}
|
||||
return $decoded;
|
||||
} catch(InvalidParamException $e) {
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Try to decode error information if it is valid json, return it if not.
|
||||
* @param $body
|
||||
* @return mixed
|
||||
*/
|
||||
protected function decodeErrorBody($body)
|
||||
{
|
||||
try {
|
||||
$decoded = Json::decode($body);
|
||||
if (isset($decoded['error'])) {
|
||||
$decoded['error'] = preg_replace('/\b\w+?Exception\[/', "<span style=\"color: red;\">\\0</span>\n ", $decoded['error']);
|
||||
}
|
||||
return $decoded;
|
||||
} catch(InvalidParamException $e) {
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
|
||||
public function getNodeInfo()
|
||||
{
|
||||
|
Reference in New Issue
Block a user