- Merge request !45#2628230 - Adding File Usage "File" relationship results in broken/missing handler → (Closed) created by Lendude
- Status changed to Needs work
almost 2 years ago 10:47pm 12 March 2023 - 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue under control, following Review a patch or merge request → as a guide.
This ticket will need a test case to show the issue.
- 🇯🇵Japan ilfelice
Howdy,
For what it's worth, after applying the patch in #99 to a Drupal 10.0.8 installation, the errors are gone and the (file) relationships work as expected in my views.
- 🇺🇸United States crutch
#99 or 53 fixes the issue for 9.5.9 when applied manually
- 🇮🇳India mohit_aghera Rajkot
Summarizing all the progress done so far.
Patch in #99 fixes the issue.
Patches from @Lendude #79 and #81 contains all the test cases.
However those got removed during next re-rolls.
One more attempt was done in comment #41, however #79 looks good enough to me.I've combined all the progress, and performed necessary tweaks in test cases and patch.
I have included an interdiff, however it mostly contains all the test cases.
Also, included test-only patch for reference. We already have a PR which is failing.Updated issue summary and hiding all other unnecessary patches.
- Status changed to Needs review
over 1 year ago 3:20pm 23 May 2023 - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass The last submitted patch, 105: 2628230-105.patch, failed testing. View results →
The last submitted patch, 105: test-only-2628230-105.patch, failed testing. View results →
- last update
over 1 year ago 29,404 pass, 1 fail - 🇮🇳India mohit_aghera Rajkot
I think I put views config files in incorrect folder and that is causing issues.
Fixing in the patch.Also, missed a couple of module dependencies in code formatting fixes.
Adding those again. All the failing tests are passing on local now. The last submitted patch, 110: 2628230-110.patch, failed testing. View results →
- last update
over 1 year ago 29,406 pass - Status changed to RTBC
over 1 year ago 2:26pm 1 June 2023 - 🇨🇦Canada nubeli
I've reviewed and tested the patch in #112, which includes tests. Looks like it's all in order. I've applied the patch with composer locally and then did a drush cache rebuild. The error disappears.
I'm not clear why this was switched to the 11.x-dev version back in #103. According to https://www.drupal.org/about/core/policies/core-release-cycles/schedule → it seems that this bug fix could even go into 9.5.x. At the very least 10.0.x.
- 🇺🇸United States smustgrave
11.x is the current development branch. All code is committed there first and case by case backported to previous versions.
- last update
over 1 year ago 29,411 pass - last update
over 1 year ago 30,377 pass - 🇫🇮Finland lauriii Finland
The fix looks right and was provided by one of the subsystem maintainers of Views 👍
The test coverage looks good 👍 Made a minor adjustments on commit to the modules installed for the test.
Committed b8e7644 and pushed to 11.x. Also cherry-picked to 10.1.x. Thanks!
This may be qualified for a backport to 10.0.x and 9.5.x but checking with other committer.
- Status changed to Needs work
over 1 year ago 7:43am 3 June 2023 - 🇳🇱Netherlands spokje
This commit has broken HEAD on 11.x and 10.1.x for pgsql only.
TestBot merrily gives us the middle finger with:
1) Drupal\Tests\file\Kernel\Views\RelationshipNodeFileDataTest::testViewsHandlerRelationshipFileToNode Drupal\Core\Database\DatabaseExceptionWrapper: Exception in test_file_to_node[test_file_to_node]: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: character varying = bigint LINE 5: ...ta" "node_field_data_file_usage" ON file_usage.id = node_fie... ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.: SELECT "file_managed"."fid" AS "fid", "node_field_data_file_usage"."nid" AS "node_field_data_file_usage_nid" FROM "test20724246file_managed" "file_managed" LEFT JOIN "test20724246file_usage" "file_usage" ON file_managed.fid = file_usage.fid INNER JOIN "test20724246node_field_data" "node_field_data_file_usage" ON file_usage.id = node_field_data_file_usage.nid AND file_usage.type = :views_join_condition_0 LIMIT 11 OFFSET 0; Array ( [:views_join_condition_0] => node ) /var/www/html/core/modules/views/src/Plugin/views/query/Sql.php:1563 /var/www/html/core/modules/views/src/ViewExecutable.php:1441 /var/www/html/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php:127 /var/www/html/core/modules/file/tests/src/Kernel/Views/RelationshipNodeFileDataTest.php:115 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 2) Drupal\Tests\file\Kernel\Views\RelationshipNodeFileDataTest::testViewsHandlerRelationshipNodeToFile Drupal\Core\Database\DatabaseExceptionWrapper: Exception in test_node_to_file[test_node_to_file]: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: bigint = character varying LINE 4: ...53file_usage" "file_usage" ON node_field_data.nid = file_usa... ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.: SELECT "node_field_data"."nid" AS "nid", "file_managed_file_usage"."fid" AS "file_managed_file_usage_fid" FROM "test13514853node_field_data" "node_field_data" LEFT JOIN "test13514853file_usage" "file_usage" ON node_field_data.nid = file_usage.id AND file_usage.type = :views_join_condition_0 INNER JOIN "test13514853file_managed" "file_managed_file_usage" ON file_usage.fid = file_managed_file_usage.fid LIMIT 11 OFFSET 0; Array ( [:views_join_condition_0] => node ) /var/www/html/core/modules/views/src/Plugin/views/query/Sql.php:1563 /var/www/html/core/modules/views/src/ViewExecutable.php:1441 /var/www/html/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php:127 /var/www/html/core/modules/file/tests/src/Kernel/Views/RelationshipNodeFileDataTest.php:177 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
See for example: https://www.drupal.org/pift-ci-job/2682293 →
Unsure if we need to do the Rollbak-Rumba, or attempt a hotfix in here.
- 🇫🇮Finland lauriii Finland
It looks like the id column is a string whereas nid is an integer. Because of this, the patch only works with MySQL which is more relaxed about types. We need to decide whether we skip the tests for other database types than MySQL and fix this for other databases in a follow-up or revert this. The reason I think it might be fine to postpone fixing PostgreSQL to a follow-up is that the experience before and after this change is pretty much the same, it's just a different error that is being triggered now.
- Status changed to Fixed
over 1 year ago 11:52am 3 June 2023 - 🇫🇮Finland lauriii Finland
Posted a patch in a follow-up issue: 🐛 Drupal\Tests\file\Kernel\Views\RelationshipNodeFileDataTest fails on HEAD with PostgreSQL Fixed .
Automatically closed - issue fixed for 2 weeks with no activity.