Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2015 at 14:10 UTC
Updated:
25 Aug 2015 at 10:50 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
subhojit777I changed the views setting and now I am showing images both from direct rendering and token rendering.

foaf:Imageis added to direct rendering but not in case of token rendering.mpdonadio in IRC said that this has nothing to do with views module, and there might be some problem with
rdfmodule and he added to look intordf_preprocess_image(). I debugged$variablesarray. Attributefoaf:Imagewas added to array during token rendering of image, but propertyschema:imageis not present.schema:imageproperty is present if I see the image in node page.Comment #3
subhojit777$variablesarray ofrdf_preprocess_image()in node page:$variablesarray ofrdf_preprocess_image()in views page:Comment #4
mpdonadio@subhojit777, can you export a view that generates the correct and incorrect output as in #2, but not using your custom module, and attach it to the issue? This does look like it could be a Views problem, but it is a little hard to tell where.
Comment #5
subhojit777Thanks @mpdonadio will look into it tonight.
Comment #6
subhojit777Steps:
typeofasfoaf:ImagetypeofasImageViews with image rendering properly:
Views with image rendering incorrectly:
Comment #7
subhojit777Comment #8
subhojit777Comment #10
subhojit777Just want to know whether I am going in the right direction before proceeding any further.
Comment #11
mpdonadio@subhojit777, I don't think that is the right path. We need to trace this through the render process and see where that attribute is getting messed up. I will take a look at it tonight (I'm UTC-4).
Comment #12
mpdonadioConfirmed. Let me play with this tonight to see where things are breaking down in the render process.
Comment #13
mpdonadioLooks like @subhojit777 was on the right path. The patch in #2466931: Valid Twig syntax is incorrectly escaped in Views rewrites introduced this problem. The Xss::filterAdmin() #post_render callback is stripping the namespace from the RDF attribute.
The culprit is the final preg_replace_callback():
The comment there is from #2501403: Document SafeMarkup::set in Xss::filter, but the SafeMarkup::set() was removed in #2506195: Remove SafeMarkup::set() from Xss::filter(). Can't quite tell what is going wrong in the regex there.
Going to make a unit test that demonstrates this.
Comment #14
mpdonadioEnough for me for the night. Here is a test that demonstrates the problem. Run `phpunit tests/Drupal/Tests/Component/Utility/XssTest.php` from CLI to see what happens.
Not really sure what the proper parent issue is here, if if matters.
Comment #15
mpdonadioComment #17
mpdonadioRoot cause is the attribute list that can contain semicolons in Xss::attributes() needs to be expanded. Not sure what others are needed for RDF.
Comment #19
olli commentedComment #20
mpdonadioYeah, this is a dup of #2544110: XSS attribute filtering is inconsistent and strips valid attributes.