Problem/Motivation

This is a weird race condition triggered by new code added by #343535: Enable bookmarking of AJAX views.

As the name says, getUrlIfValid() can return FALSE. I can't reproduce it locally, but on our CI, this happens pretty reliably on one specific test and I think it's because that entity is getting deleted by the test cleanup while some ajax operation is still running, but it could be all sorts of reasons.

Steps to reproduce

Proposed resolution

Check if $target_url is set before using it

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3560093

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

berdir created an issue. See original summary.

berdir’s picture

Title: $target_url in \Drupal\views\Controller\ViewAjaxController::ajaxView can be NULL » $target_url in ViewAjaxController::ajaxView can be NULL

berdir’s picture

Issue summary: View changes
Status: Active » Needs review

Added a fix with unit test coverage

lendude’s picture

Status: Needs review » Reviewed & tested by the community

Fix makes sense, test looks good and I think shows the code path pretty clearly that isn't being accounted for currently.

  • longwave committed babbb202 on 11.3.x
    fix: #3560093 $target_url in ViewAjaxController::ajaxView can be NULL...
longwave’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Also not sure how this could happen, but I guess it does! Backported down to 11.3.x as an eligible bug fix; doesn't apply cleanly to 10.6.x.

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.

  • longwave committed 94302d39 on 11.x
    fix: #3560093 $target_url in ViewAjaxController::ajaxView can be NULL...

  • longwave committed c32f2c70 on main
    fix: #3560093 $target_url in ViewAjaxController::ajaxView can be NULL...

Status: Fixed » Closed (fixed)

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