summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlex Pott2018-12-28 08:10:30 (GMT)
committerAlex Pott2018-12-28 08:10:39 (GMT)
commitb6e5032aba2a0caaba91b4398a0a5aec1211704c (patch)
tree4a0fe235cce61bf01e83b4b6978a28ef4d3721e4 /core
parent0756a4e4fce598f410899b63322e0915c63deec8 (diff)
Issue #3020902 by Berdir, alexpott: PostgresqlDateSql fails to serialize
(cherry picked from commit 60574dd038d9254cca63dad5c477e7890b16da3e)
Diffstat (limited to 'core')
-rw-r--r--core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php3
-rw-r--r--core/modules/views/src/Plugin/views/query/SqliteDateSql.php3
-rw-r--r--core/modules/views/tests/src/Kernel/ViewElementTest.php3
3 files changed, 9 insertions, 0 deletions
diff --git a/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php b/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
index c03c416..c919fad 100644
--- a/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
+++ b/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
@@ -3,6 +3,7 @@
namespace Drupal\views\Plugin\views\query;
use Drupal\Core\Database\Connection;
+use Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
* PostgreSQL-specific date handling.
@@ -14,6 +15,8 @@ use Drupal\Core\Database\Connection;
*/
class PostgresqlDateSql implements DateSqlInterface {
+ use DependencySerializationTrait;
+
/**
* The database connection.
*
diff --git a/core/modules/views/src/Plugin/views/query/SqliteDateSql.php b/core/modules/views/src/Plugin/views/query/SqliteDateSql.php
index 628e1c6..2275d4c 100644
--- a/core/modules/views/src/Plugin/views/query/SqliteDateSql.php
+++ b/core/modules/views/src/Plugin/views/query/SqliteDateSql.php
@@ -3,6 +3,7 @@
namespace Drupal\views\Plugin\views\query;
use Drupal\Core\Database\Connection;
+use Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
* SQLite-specific date handling.
@@ -14,6 +15,8 @@ use Drupal\Core\Database\Connection;
*/
class SqliteDateSql implements DateSqlInterface {
+ use DependencySerializationTrait;
+
/**
* The database connection.
*
diff --git a/core/modules/views/tests/src/Kernel/ViewElementTest.php b/core/modules/views/tests/src/Kernel/ViewElementTest.php
index c6149e9..2dbc31c 100644
--- a/core/modules/views/tests/src/Kernel/ViewElementTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewElementTest.php
@@ -82,6 +82,9 @@ class ViewElementTest extends ViewsKernelTestBase {
$this->assertEqual($render['#embed'], TRUE);
$this->setRawContent($renderer->renderRoot($render));
+ // Ensure that the render array can be serialized.
+ serialize($render);
+
$xpath = $this->xpath('//div[@class="views-element-container"]');
$this->assertTrue($xpath, 'The view container has been found in the rendered output.');