- 🇺🇸United States smustgrave
Since it doesn’t show changes what was updated?
- 🇺🇸United States pyrello
I'm adding myself back in for credit on the commit, since versions of this since my patch use the
preparePreview()
method I introduced. - 🇺🇸United States pyrello
Hmm... I guess I don't have permission to update credit.
- Status changed to Needs review
over 1 year ago 3:45pm 9 March 2023 - 🇺🇸United States smustgrave
Since I've been bit by this before going to try and help get it over the finish line.
Updated issue summary and updated patch for D10 practices.
The last submitted patch, 95: 2605218-95.patch, failed testing. View results →
- 🇺🇸United States smustgrave
Had to update the test case to do specific checks for view_query vs full array compare.
- Status changed to Needs work
over 1 year ago 7:57am 7 April 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- Status changed to Needs review
over 1 year ago 8:29am 7 April 2023 - 🇳🇱Netherlands Martijn de Wit 🇳🇱 The Netherlands
Does the bot still works? l-)
- Status changed to Needs work
over 1 year ago 9:07am 7 April 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇫🇷France nod_ Lille
still works, patch does not apply anymore. Last test run was last month.
- Status changed to Needs review
over 1 year ago 2:07pm 7 April 2023 The last submitted patch, 102: 2605218-102.patch, failed testing. View results →
The last submitted patch, 104: 2605218-104.patch, failed testing. View results →
- 🇺🇸United States smustgrave
The tests were broken by
I ended up removing
// Test that no unwanted parameters are added to the URL. $this->assertEquals('?view_query=_wrapper_format%3Ddrupal_ajax&status=All&type=All&langcode=All&items_per_page=5&order=changed&sort=asc&wrapper_format=drupal_ajax&page=2', $link->getAttribute('href'));
Even without the branch the Hrefs are crazy long. Not sure it's in scope of this issue to fix that part.
- Status changed to Needs work
over 1 year ago 2:02pm 8 April 2023 - 🇳🇱Netherlands Lendude Amsterdam
Both points in #31 still need to be addressed.
Also, the test coverage needs to be expanded, we are making changes to javascript files so we need to have a javascript test I'd think.
- 🇧🇷Brazil carolpettirossi Campinas - SP
I've tested patch #94 on my project running Drupal 9.5.8 and it worked as expected =)
In my case, I have a view listing articles with views_infinite_scroll to use "Load More" as pages. The load more functionality + AJAX worked fine when the views block was placed on the page using the default settings.
However, when I updated the settings to display 3 blocks per page instead of 12, the "Load more" broke and the "No results" message.Attaching a video/screencast of my scenario.
- 🇳🇿New Zealand danielveza Brisbane, AU
Having a look at the patch, I think #88 still needs to be addressed too
- 🇧🇷Brazil carolpettirossi Campinas - SP
Actually, I'm sorry about the early celebration on patch #94.
It seems that issue #88 also happens to me.
The second time I click on "Load more" the block_config_key and page are added to params in the URL. I'm using AJAX view though.
- Status changed to Needs review
over 1 year ago 6:43am 18 July 2023 - last update
over 1 year ago 29,445 pass, 2 fail - 🇷🇴Romania alex.stanciu
I reworked this a bit on the 10.1.x branch addressing the previous comments:
- #88: I removed the JS changes, they did not seem necessary and was creating a very long query string. Click sorting persists between AJAX requests just fine. Not sure why we needed it in the first place, but in my testing, it works fine without it.
- #31 (1) I kept the key_value implementation but I added hooks for view_update, view_delete, block_update and block_delete. Whenever we update/delete a view or block, we remove the key_value entry. Thus eliminating the risk of bloat adding up over time
- #31 (2) I changed the key_value structure to be a nested array, keyed by the view id and reworked a bit the function used to generate the hash. Thus eliminating the risk of colisions.
- The last patch was not working at all on 10.1.x because it was using
->getRequest()->request->get()
I changed it to->getRequest()->query->get()
The last submitted patch, 112: 2605218-112.patch, failed testing. View results →
- last update
over 1 year ago Custom Commands Failed - 🇷🇴Romania alex.stanciu
Applied this to 11.x and fixed a failing test case.
- last update
over 1 year ago 29,814 pass, 2 fail The last submitted patch, 115: 2605218-115.patch, failed testing. View results →
- Merge request !4399Issue #2605218: Views Block Display skips preBlockBuild() call on ajax rebuild → (Open) created by pyrello
- last update
over 1 year ago 29,818 pass, 2 fail - last update
over 1 year ago 29,817 pass, 1 fail - 🇺🇸United States pyrello
I think I fixed the error in the test that was failing, but I didn't really understand what I was doing.
- last update
over 1 year ago 29,820 pass - Status changed to Needs work
over 1 year ago 4:19pm 19 July 2023 - 🇧🇷Brazil carolpettirossi Campinas - SP
When I try to apply #115 on Drupal 10, it applied successfully. However, I get this
Fatal error: Cannot redeclare views_view_delete() (previously declared in /var/www/web/core/modules/views/views.module:809) in /var/www/web/core/modules/views/views.module on line 835
when I run
drush cr
- last update
over 1 year ago Build Successful - Status changed to Needs review
over 1 year ago 6:52pm 19 July 2023 - last update
over 1 year ago Build Successful - Status changed to Needs work
over 1 year ago 5:05pm 20 July 2023 - last update
over 1 year ago 29,828 pass - Status changed to Needs review
over 1 year ago 6:30pm 20 July 2023 - 🇺🇸United States pyrello
Learning curve for adding the deprecation notice :)
- last update
over 1 year ago 29,840 pass - Status changed to RTBC
over 1 year ago 5:21pm 21 July 2023 - 🇺🇸United States smustgrave
Thanks for taking care of that. Lets see if we can move this along and hopefully get into 10.2!
- last update
over 1 year ago 29,879 pass - last update
over 1 year ago 29,882 pass - last update
over 1 year ago 29,886 pass - last update
over 1 year ago 29,909 pass - last update
over 1 year ago 29,912 pass - last update
over 1 year ago 29,947 pass - last update
over 1 year ago 29,954 pass - last update
over 1 year ago 29,954 pass - last update
over 1 year ago 29,954 pass, 1 fail - last update
over 1 year ago 29,959 pass - last update
over 1 year ago 29,959 pass 1:58 0:42 Running- last update
about 1 year ago 29,968 pass - 🇳🇿New Zealand quietone
I read the issue summary and comments and I didn't find any unanswered questions. I was concerned that #31 and #88 were missed but there were responded to in #112. And there are no outstanding tags here. I didn't look at the MR (it is too late).
- last update
about 1 year ago 30,050 pass - last update
about 1 year ago 30,057 pass - last update
about 1 year ago 30,057 pass - last update
about 1 year ago 30,059 pass - last update
about 1 year ago 30,061 pass - 🇮🇳India mohit_aghera Rajkot
Re-rolling the #94 for 9.5.x since I need to use it for one project.
Mostly it was minor nit pick related to coding standard.
All 3 test cases are passing on local.I've hide the patch since 9.5.x support is going to end soon.
Keeping the status as it is. - last update
about 1 year ago 30,339 pass, 1 fail - last update
about 1 year ago 30,064 pass - last update
about 1 year ago 30,130 pass, 2 fail - last update
about 1 year ago 30,136 pass - Status changed to Needs work
about 1 year ago 8:40am 3 September 2023 - 🇳🇿New Zealand quietone
I cam back and some of the MR. Since I found a few things that should be fixed I am setting this back to needs work.
- last update
about 1 year ago Custom Commands Failed - last update
about 1 year ago Custom Commands Failed - last update
about 1 year ago 30,418 pass - Status changed to Needs review
about 1 year ago 10:46pm 18 October 2023 - last update
about 1 year ago 30,418 pass 37:00 31:14 Running- Status changed to RTBC
about 1 year ago 4:04pm 19 October 2023 - 🇺🇸United States smustgrave
Love this new test-only feature
There were 2 errors: 1) Drupal\Tests\views\Unit\Plugin\views\display\BlockTest::testBuildNoOverride PHPUnit\Framework\MockObject\CannotUseOnlyMethodsException: Trying to configure method "calculateConfigurationHash" with onlyMethods(), but it does not exist in class "Drupal\views\Plugin\views\display\Block". Use addMethods() for methods that do not exist in the class /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php:253 /builds/issue/drupal-2605218/core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php:104 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/Command.php:144 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/Command.php:97 2) Drupal\Tests\views\Unit\Plugin\views\display\BlockTest::testBuildOverride PHPUnit\Framework\MockObject\CannotUseOnlyMethodsException: Trying to configure method "calculateConfigurationHash" with onlyMethods(), but it does not exist in class "Drupal\views\Plugin\views\display\Block". Use addMethods() for methods that do not exist in the class /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php:253 /builds/issue/drupal-2605218/core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php:104 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/Command.php:144 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/Command.php:97 -- There was 1 risky test: 1) Drupal\Tests\views\Unit\Plugin\views\display\BlockTest::testBuildNoOverride This test did not perform any assertions /builds/issue/drupal-2605218/core/tests/Drupal/Tests/Listeners/DrupalListener.php:65 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestResult.php:452 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestResult.php:980 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/Command.php:144 /builds/issue/drupal-2605218/vendor/phpunit/phpunit/src/TextUI/Command.php:97 ERRORS!
Remarking as appears feedback @quietone has been resolved, all threads closed, and green.
- last update
about 1 year ago 30,427 pass - last update
about 1 year ago 30,428 pass - last update
about 1 year ago 30,438 pass - last update
about 1 year ago 30,457 pass - last update
about 1 year ago 30,465 pass - last update
about 1 year ago 30,484 pass - last update
about 1 year ago 30,486 pass 46:57 43:06 Running- last update
about 1 year ago 30,489 pass - last update
about 1 year ago 30,512 pass - last update
about 1 year ago 30,517 pass - last update
about 1 year ago 30,523 pass, 2 fail - last update
about 1 year ago 30,551 pass, 1 fail - last update
12 months ago 30,561 pass - last update
12 months ago 30,603 pass - last update
12 months ago 30,606 pass - last update
12 months ago 30,607 pass - Status changed to Needs review
12 months ago 5:19pm 23 November 2023 - Status changed to Needs work
11 months ago 7:38am 7 December 2023 - 🇧🇪Belgium herved
Here's a patch version of MR 4399 (latest commit 21efdb1b), if anyone else needs it.
PS: our setup enforces static patches and MR diffs are not allowed (as they can change unexpectedly). - last update
11 months ago 30,725 pass - 🇺🇸United States gtucker6
I hate to be the bearer of bad news on such a long sought after solution for this, but the patches above do not work for 10.3 (I can't verify for Drupal 9 and below). This is also not an ideal nor practical solution. The getBlockFromAjaxRequest() method that was added does not return the expected results. The block gets a duplicate config key and also returns null on the first ajax request via elementPreRender(). The preBlockBuild() function does not get called still because the ajax architecture only returns the view (the block is a wrapper around the view and does not get updated).
My solution for the client that needed this was as follows:
1. Add Drupal JS settings for views blocks: $build['#attached']['drupalSettings']['viewsBlock'][$this->view->dom_id] = $block->getConfiguration();
2. Add a new method to the views block display and views block plugin to add the settings to the build: alterBlockBuild(ViewsBlock $block, &$build)
3. Add an event subscriber with a that responds to the ViewAjaxResponse response and checks for the block display handler
4. Add an ajax command that responds on ajax and uses the block settings for updating the viewI really think our proposed solution should be changed to something similar to above. This way is much cleaner and follows the ajax workflow mostly with views. Any module that overrides views block settings could then implement their own subscriber and ajax commands with the new viewsBlock drupal settings in the block build.
I spent over 25 hours on this issue, and the only way I could get block settings to update the view, was via drupalSettings on the views block and an ajax command that fires on the response of ViewsAjaxResponse.
- 🇺🇸United States joshua.boltz
This is indeed an interesting issue. I just stumbled upon this issue in debugging and researching the issue I am facing.
I'm not really sure if my issue and this issue are the same issue with the same root cause and necessary solution, but it seems somewhat related, so I thought I would chime in with my case.I have a block and I am loading a View programmatically.
The view has pagination enabled and I am seeing odd behavior on the rendered view when using the pagination.I believe that the Ajax pagination is losing sight of how the View should be processed for rendering.
I am seeing things like:
* Duplicated results in the view
* Missing results in the viewI can sort of confirm this by enabling XDebug, and when using the Ajax pagers in the view, XDebug does not hit on the lines where I am loading and setting properties in the view for how I need it manipulated and rendered in my block.