Needs review
Project:
Views PHP
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jan 2016 at 13:06 UTC
Updated:
25 Apr 2020 at 14:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gajanannehul commentedComment #3
nikunjkotechaIs <?php opening twice really used and working?
Comment #4
gajanannehul commentedIts by mistake <?php open twice Nikunj. I have updated issue.
Comment #5
sajiniantony commentedI am also facing the same issue in views .please advice
Comment #6
navalogan commentedHi all,
I have the same issue! Has anyone got a solution for this?
Thanks!
Comment #7
navalogan commentedAny news for this issue?
thx
Comment #8
Leagnus commentedConfirm the bug.
let's solve it this way:
in views-view-field.html.twig:
Comment #9
alanpeart commentedNice solution Leagnus! thanks.
Comment #10
guignonvThanks for the trick Leagnus! I created a custom module for the hook and a custom theme for the twig template and it worked well!
Comment #11
rahul patidar commentedVery helpful #8. Very many thanks Leagnus!
Comment #12
noopal commentedIs it solved or not?
Im using 8 and when I use html tags they get printed instead of rendered as html.
Can you advise how I can turn html from raw text to rendered html?
Thanks
Comment #13
rahul patidar commentedYou can set debug: FALSE in your service.yml file, but this will prevent the debugging for the site. So if you want to remove this without setting debug: FALSE, you have to create a twig extension in you module for removing html tags and comments. These are the steps for creating twig extension in my_module module:
Comment #14
johnvAs a maintainer,I am not sure if this needs a fix in the module itself. All solutions are fixes in custom code.Is a fix in the module itsef needed/possible? IF so, how?
I lowered the priority, since the error only appears when additional custom code is used.
[EDIT] Sorry, wrong queue, I am not a maintainer fo this module.
Comment #15
gerson.analista commentedI have the same problem.
Researched how the native field "Custom text" of the Views module works (this field allows return of HTML).
"Custom text" field code:
https://api.drupal.org/api/drupal/core!modules!views!src!Plugin!views!fi...
See how the field value is returned in the render method:
I made a patch to apply the same type of return in the render function of Views PHP module.
I think it worked, could you help me test it?
Comment #16
boby_ui commentedconfirm #15 is working with 8.8.5 version
Comment #17
alternativo commentedHi guys,
Using D8.8.5 from code in custom module, new node of 'alpha' type is created, filling a formatted long text field 'description' with '...my text...'
Created a view of node type alpha, with HTML format list of that field 'description'
When i see the view, the text is formatted as plain...so '
....my text...
'
After I open a node, if I click on EDIT, doing no modify, and SAVE, the view shows the right HTML format.
Tried to use ViewsRenderPipelineMarkup::create(Xss::filterAdmin($description)), and only and tag disappear, but no HTML rendering.
also tried function Html::escape($description) but still same problem, all tags rendered as plain text.
Tried also with template raw rendering, no changes.
Any ideas how to solve?
thanks