Problem/Motivation
SectionComponent is passed a Boolean named $in_preview, which indicates whether or not the component is being previewed or being shown at runtime.
When it is being previewed, access on the plugin is not consulted, as all components should be shown for rearranging.
However, the plugin access is still computed and this can lead to side-effects and possible exceptions if the plugin does not have all the contexts it needs.
For example, when using the paragraph module the ParagraphAccessControlHandler is run for its corresponding FieldBlock.
ParagraphAccessControlHandler assumes that its parent entity will exist in the database, which is not true during preview.
Proposed resolution
Instead of computing access and then ignoring it, skip computing the access when in preview.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | 2942600-preview_access-7-PASS.patch | 4.6 KB | tim.plunkett |
#7 | 2942600-preview_access-7-FAIL.patch | 2.49 KB | tim.plunkett |
#4 | 2942600-preview_access-4.patch | 4.6 KB | tim.plunkett |
#4 | 2942600-preview_access-4-interdiff.txt | 590 bytes | tim.plunkett |
#2 | 2942600-preview_access-2.patch | 4.6 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettComment #4
tim.plunkettUgh, reminder to not add code after running tests, without rerunning them again.
Comment #5
EclipseGc CreditAttribution: EclipseGc at Acquia commentedThis looks super reasonable to me.
Eclipse
Comment #6
xjmThis is logically the same, but now only calculated when
$in_preview
is not true, so that's cool too (and this is the bugfix).Also confusing, but logically the same.
This comment scared me at first, but then @tim.plunkett pointed out that this is already the logic when
$in_preview
is true.I asked @tim.plunkett to post a test-only patch. Leaving at RTBC since that is not an actual change that would need to be re-reviewed.
Comment #7
tim.plunkettPosting the test only patch, in addition to the identical patch from above.
The expected fail should be
It should not be called, but it will be in HEAD.
Comment #10
xjmCommitted and pushed to 8.6.x, thanks!
This is a contrib blocker so marking RTBC against 8.5.x for backport once the freeze for beta is over.
Comment #12
EclipseGc CreditAttribution: EclipseGc at Acquia commentedThis still applies to 8.5.x so not sure what the deal with testbot is. Re-rtbcing.
Eclipse
Comment #13
EclipseGc CreditAttribution: EclipseGc at Acquia commentedComment #14
tim.plunkettThis is major as a contributed project blocker.
Comment #16
xjmNow cherry-picked and backported to 8.5.x as well. Thanks!
Comment #17
tim.plunkett