Problem/Motivation

When creating a View the preview crashes if the query display is enabled.

Steps to reproduce

Install External Entities and External Entities Views Integration.
Configure an external entity.
Enable the query display in Views.
Build a view of the external entity.

The preview cannot be rendered because Views UI assumes the query can be implicitly cast to a string in core/modules/views_ui/src/ViewUI.php:

$query_string = $executable->build_info['query'];
 ...
'#context' => ['query' => strtr($query_string, $quoted)],

Proposed resolution

Make EE's Query object implement \Stringable and add a dummy __toString method.

Remaining tasks

None

User interface changes

None (The preview works, though the querystring is just a placeholder.)

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

twod created an issue. See original summary.

guignonv’s picture

Status: Needs review » Fixed

Fair nought. Merged. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.