From entity browser issue https://www.drupal.org/node/2902831 . The entity browser base display redefines ajaxEnabled() to force use of Ajax for these Views in ckeditor modals. The recent SA patch breaks displays that rely on this API mechanism to determine ajaxness.

API function $display->ajaxEnabled() should be used to determine whether a display is using AJAX because it abstracts the underlying setting (and would helpfully reveal downstream usage to the function autodoc). Views source is currently consistent in this usage except for the recent SA patch, which bypasses the API:

if ($view && $view->access($display_id) && $view->setDisplay($display_id) && $view->display_handler->getOption('use_ajax')) {
  // show the view
}
else {
 // 403
}

See https://api.drupal.org/api/drupal/core%21modules%21views%21src%21Plugin%...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ahebrank created an issue. See original summary.

samuel.mortenson’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Active » Needs review
samuel.mortenson’s picture

Version: 8.4.x-dev » 8.3.x-dev
dawehner’s picture

Let's fix the unit tests ...

dawehner’s picture

Haha, this time with a patch.

Status: Needs review » Needs work

The last submitted patch, 5: 2904798-5.patch, failed testing. View results

dawehner’s picture

Priority: Normal » Major
Status: Needs work » Needs review
FileSize
1.56 KB

Note: This broke an entity browser view for me, as use_ajax was false in this case. Given that I'm moving it to major.

This time here is a patch which actually has the right fixes.

dawehner’s picture

FileSize
599 bytes

Here is also an interdiff.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, trivial fix.

Entity Browser now also has an RTBC workaround by overriding both methods. but still makes sense to fix this asap.

  • catch committed 0f36528 on 8.5.x
    Issue #2904798 by dawehner, ahebrank: 8.3.7 Views SA patch should use...

  • catch committed 6b9ffd8 on 8.4.x
    Issue #2904798 by dawehner, ahebrank: 8.3.7 Views SA patch should use...

catch credited catch.

catch’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!

I don't think we'll do another 8.3.x release so leaving fixed at 8.4.x, but if that changes we can cherry-pick it back.

keithdoyle9’s picture

Anyone know where I can get an 8.3.x patch? I guess I could just generate one, it looks like the only difference is that it's line 145 instead of 142.

Berdir’s picture

This is fixed in the latest entity_browser version as well, so if you have this problem because of that module, you can update that and should be fine. It's even enough to edit the views and explicitly mark them as ajax-enabled, both the core and the entity browser patch are only there to prevent that from being necessary.

keithdoyle9’s picture

After updating entity_browser to the latest version and going into each view used to make sure AJAX is selected and re-saving, I still get an AJAX / 404 error when trying to select files in the file_browser_modal.

Status: Fixed » Closed (fixed)

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