PanelizerFieldPanelsStorage::access() calls entity access with incorrect operations and excludes cacheability metadata. This results in false negatives, and incorrectly cached access results.

Panels storage access operations different from entity access operations, yet the class maps them almost directly, with exception of the change layout operation.

No user account or entity cacheability metadata is included in the access result, which means that dependent data, such as render arrays, is not cleared from the cache when the target entity or the user are updated, for instance.

Comments

Xano created an issue. See original summary.

xano’s picture

Status: Active » Needs review
StatusFileSize
new2.19 KB

Status: Needs review » Needs work

The last submitted patch, 2: panelizer_2716071_2.patch, failed testing.

dsnopek’s picture

Thanks! In general, the patch looks good. It looks like the tests might need to be updated, though?

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new3.07 KB
new4.33 KB

And here's the updated test. I wanted to see what would break first.

This makes the tests pass, but does not yet test whether cacheability metadata is bubbled up properly. That requires a more invasive change of the existing test methods, as the API's required data types (AccessResultInterface, AccountInterface) does not provide this metadata by default.

arknoll’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Tested. Works well. Also moving to a high priority. Without this editing panels panes fails for anyone except users with very high node access privileges.

sk33lz’s picture

The patch in #5 still works with the latest 3.x-dev release from Oct. 14th. I just applied it with no issues.

dsnopek’s picture

+1 on this - just need a passing test build (I queued a new one in case this was just a Drupal 8.3.x failure)

  • dsnopek committed 54f0ac6 on 8.x-3.x authored by Xano
    Issue #2716071 by Xano: PanelizerFieldPanelsStorage::access() calls...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Thanks, Xano, and everyone who tested!

Status: Fixed » Closed (fixed)

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