Closed (works as designed)
Project:
Entity Embed
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2015 at 05:08 UTC
Updated:
5 Dec 2018 at 16:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dave reidComment #3
phenaproximaI'm postponing this on #2328659: Convert all existing entity_embed tests from WebTestBase to BrowserTestBase.
Comment #4
wim leersComment #5
phenaproximaBlocker is in.
Comment #6
phenaproximaHere's a basic test of embedding an unpublished node, confirming it is not rendered for the unpublished user.
Comment #7
oknateIt looks like unpublished nodes were already handled in EntityEmbedFilterTest::testFilter():
I think maybe testFilter could be broken up, otherwise, I think patch #6 is redundant to code starting on line 46.
Comment #8
oknateAlso patch doesn't handle "private file". I'm not sure what a private file is. When you serve files from the private file system. What would testing instructions be for that? What's a use case where you'd be embedding files from outside the web root?
Comment #9
wim leersComment #10
wim leers#7++ — great point!
#8:
Perhaps not realistic, but the whole point of this issue is that we ensure edge cases are not disclosing information inappropriately. an article where there's sneak previews for paying members?
Working on adding test coverage added for private files. Borrowing some code from
\Drupal\Tests\editor\Functional\EditorPrivateFileReferenceFilterTest::testEditorPrivateFileReferenceFilter(). Patch tomorrow; it's late here.Comment #11
wim leersI banged my head against the wall for hours wrt private files. Turns out I've been foiled by code I've written myself over 5 years ago in #1932652: Add image uploading to WYSIWYGs through editor.module. Turns out that you don't need to enable the
\Drupal\editor\Plugin\Filter\EditorFileReferencefilter to have it start tracking usage;editor_entity_insert()will automatically scan all entities' text fields and track their usage, with since #2744197: Proper private file support for images uploaded via EditorImageDialog theeditor_file_download()hook implementation granting access to private files if they're tracked by the Text Editor module and the referencing entity is accessible.So … creating Entity Embed private file test coverage is actually pretty pointless. It'd just be duplicating test coverage of
\Drupal\Tests\cdn\Kernel\EditorFileReferenceFilterTest.Thanks A LOT to @phenaproxima to help find the root cause of this! He agreed with this assessment.
Comment #12
wim leers