Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
text.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2012 at 18:41 UTC
Updated:
10 Dec 2015 at 18:53 UTC
Jump to comment: Most recent
Comments
Comment #1
ambientdrup commentedI've figured this out!
If I change the text processing on the Body field in the content type to "Plain Text" (vs. filtered text) then the safe_value shows up on the Body object in Devel.
So there's something causing the issue with the text processing when it's set to filtered text (user selects format). It works fine with plain text. Or is this by design in Drupal 7.x core?
So this shows that it is working with our core install. It's just that our text processing is messing it up somewhere when we have filtered text selected as the text processing. It works when plain text is selected.
Does this make sense?
-Trevor
Comment #2
ambientdrup commentedBut I still have a question here - why does safe_value not show up in Devel when you have another text processing like Full HTML set on the field? Shouldn't that also be available to the array in Devel when you inspect the element?
-Trevor
Comment #3
h3rj4n commentedThe safe_value should always popup. Tested on a site of mine and there the safe_value is set even with plain_text.
But you are saying that the safe_value doesn't popup when the text processing is set to Full HTML?
Is it possible that when there are no filters present in '/admin/config/content/formats' one of these filters there isn't a safe_value?
Comment #4
ambientdrup commentedSo I checked my formats. I have the Node Embed module installed and this adds a checkbox to the formats to allow for an additional filter called "Insert Node". When I save the format with the Insert Node filter, then I can't get safe_value to show/work. So there's some conflict going on with the Node Embed module. I've verified this both on my local dev site and our staging site.
-Trevor
Comment #5
ajdonnison commentedThis appears to be when you have multiple filters (or modules that silently implement filters) that extensively use preg_replace_callback or preg_replace with the 'e' modifier. If you edit php.ini and update the pcre.backtrack_limit to a higher value this should resolve the issue. The default value is 100000, adding two more zeroes fixed the problem for me, ymmv.
Comment #6
pivanov commentedThe value key "save_value" of "Long Text" fields is set given either of these two is true:
1) text processing is NOT enabled,
2) text processing is enabled and all filters associated with the format are cachable (see the filter info hook)
See https://api.drupal.org/api/drupal/modules%21field%21modules%21text%21tex...
Note that this applies to fields being attached to the node when the node is loaded.
For display purposes, such as printing the values from the node template, see the
field_attach_prepare_view()function which will actually prepare a renderable array, that will apply the proper text format.