Skip to content
Permalink
Browse files

Resurrect changes from #8131

These changes were lost when we moved to the 3.next branch. This revives
those changes and solves #8259
  • Loading branch information...
markstory committed Mar 2, 2016
1 parent f84ab99 commit 2224d73f86ff6a13e7bb276791a1651089d60170
Showing with 10 additions and 6 deletions.
  1. +0 −1 src/Error/ExceptionRenderer.php
  2. +1 −1 src/Mailer/Email.php
  3. +2 −2 src/ORM/Table.php
  4. +1 −1 src/View/JsonView.php
  5. +6 −1 src/View/SerializedView.php
@@ -183,7 +183,6 @@ public function render()
'format' => 'array',
'args' => false
]);
$viewVars['_serialize'][] = 'trace';
}
$this->controller->set($viewVars);
@@ -1012,7 +1012,7 @@ protected function _constructTransport($name)
$className = App::className($config['className'], 'Network/Email', 'Transport');
trigger_error(
'Transports in "Network/Email" are deprecated, use "Mailer/Transport" instead.',
E_USER_WARNING
E_USER_DEPRECATED
);
}
@@ -1030,7 +1030,7 @@ public function findList(Query $query, array $options)
if (isset($options['idField'])) {
$options['keyField'] = $options['idField'];
unset($options['idField']);
trigger_error('Option "idField" is deprecated, use "keyField" instead.', E_USER_WARNING);
trigger_error('Option "idField" is deprecated, use "keyField" instead.', E_USER_DEPRECATED);
}
if (!$query->clause('select') &&
@@ -1096,7 +1096,7 @@ public function findThreaded(Query $query, array $options)
if (isset($options['idField'])) {
$options['keyField'] = $options['idField'];
unset($options['idField']);
trigger_error('Option "idField" is deprecated, use "keyField" instead.', E_USER_WARNING);
trigger_error('Option "idField" is deprecated, use "keyField" instead.', E_USER_DEPRECATED);
}
$options = $this->_setFieldMatchers($options, ['keyField', 'parentField']);
@@ -129,7 +129,7 @@ public function render($view = null, $layout = null)
*
* @param array|string|bool $serialize The name(s) of the view variable(s)
* that need(s) to be serialized. If true all available view variables.
* @return string The serialized data
* @return string|false The serialized data, or boolean false if not serializable.
*/
protected function _serialize($serialize)
{
@@ -17,6 +17,7 @@
use Cake\Event\EventManager;
use Cake\Network\Request;
use Cake\Network\Response;
use RuntimeException;
/**
* Parent class for view classes generating serialized outputs like JsonView and XmlView.
@@ -85,7 +86,11 @@ public function render($view = null, $layout = null)
}
if ($serialize !== false) {
return $this->_serialize($serialize);
$result = $this->_serialize($serialize);
if ($result === false) {
throw new RuntimeException('Serialization of View data failed.');
}
return (string)$result;
}
if ($view !== false && $this->_getViewFileName($view)) {
return parent::render($view, false);

0 comments on commit 2224d73

Please sign in to comment.
You can’t perform that action at this time.