Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
ViewExecutableTest fails currently with PostgreSQL as database backend.
Proposed resolution
Identify and fix the failing tests.
Remaining tasks
Write patch.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2443701-5.patch | 2.35 KB | daffie |
Comments
Comment #1
bzrudi71 CreditAttribution: bzrudi71 commentedJust spend some minutes to fix this one. The root cause is an exception in a views.view.test_destroy.yml. In particular caused by the filter statement for the content-id (nid) which is set to equals. But there seems to be no nid avail and thus resulting in an PostgreSQL exception in testDestroy():
Drupal\Core\Database\DatabaseExceptionWrapper: Exception in test_destroy[test_destroy]: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 12: WHERE (( (node.nid = '') AND (node_field_data.status = '0') ... ^ in Drupal\views\Plugin\views\query\Sql->execute() (line 1451 of /opt/local/apache2/htdocs/drupal8/core/modules/views/src/Plugin/views/query/Sql.php).
In addition I see a warning in the tests in an earlier state:
setDisplay() called with invalid display ID "invalid".
Not sure if this is related.
BTW Changing the filter criterium to is empty makes tests pass..
Comment #2
dawehner@bzrudi71
I think you could add something like:
value: 0
value: true
value: ""
<?code> depending on string / integer / boolean of the field.
Comment #3
bzrudi71 CreditAttribution: bzrudi71 commentedAh, I see! Changed the filter to use a default value of 0 and test passes now. Thanks @dawehner!
Comment #5
daffie CreditAttribution: daffie commentedRerolled, no code changes.
Comment #6
daffie CreditAttribution: daffie commentedIt all looks good to me.
Comment #7
alexpottCommitted 09891b7 and pushed to 8.0.x. Thanks!