Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting this error when i click on tabs "active topics"Un answered topic" and "new updated topics" this wont appear when we are in "view forums"
Warning: html_entity_decode() expects parameter 1 to be string, object given in decode_entities() (line 429 of E:\wamp\www\includes\unicode.inc).
Can some one help me on this?
Comments
Comment #1
troky CreditAttribution: troky commentedIt doesn't look like AF problem. includes/unicode.inc is core file.
Comment #2
rooby CreditAttribution: rooby commentedJust because it is a core file doesn't mean it is a core bug.
It just means some module is calling function decode_entities() with an array as the parameter instead of a string.
Or it could be some module calling a function that then calls decode_entities(), etc.
That module could be advanced forum.
Best way to check is for the original poster to do this:
1. In the includes/unicode.inc file change this code:
to this:
2. Visit the page on your site where the error occurs. - You should see a huge output of text.
3. Copy the text into a txt file and post the file back here.
That way we can identify the module that is causing the problem.
Alternately, you can inststall the devel module and replace the line
print_r(debug_backtrace());
in the above code withdd(debug_backtrace());
, visit the error page and then post back here the drupal_debug.txt file that has been created in your temp files directory (/tmp by default). The output of this option is more readable.Comment #3
piriya33 CreditAttribution: piriya33 commentedI am getting the same problem, will try the debug code and give the result in a minute
Comment #4
piriya33 CreditAttribution: piriya33 commentedThis is what I got.
A bunch of
Warning: html_entity_decode() expects parameter 1 to be string, object given in decode_entities() (line 432 of /opt/bitnami/apps/drupal/htdocs/includes/unicode.inc).
11 in total (Just the same text over and over.)
All it did is just made the file a bit longer and now the error occured in line 432 instead of 429 .. heh.
I've tried both printing the debug code and creating a debug log
nothing happens.
no drupal_debug.txt showed up in /tmp (root, am I in the right place?)
Comment #5
rooby CreditAttribution: rooby commented@piriya33:
Sorry, I made a mistake in my debug code snippet.
The error says object given so in the debug snippet change:
if (is_array($text)) {
to:
if (is_object($text)) {
Yes, that is where it should be by default in drupal, although it is possible to change drupal's temporary files directory to something else in drupal's administration settings.
Comment #6
piriya33 CreditAttribution: piriya33 commented@rooby Ok, tried that.
After changing array to object, these are what I got.
printr option. - The Link (Active / Unanswered etc.) just gave me an internal error 500
dd option. - the original error shows up, still , no log file. I had the dev version of the module installed too.
Am I doing something wrong?
Comment #7
piriya33 CreditAttribution: piriya33 commentedI've updated (well, reverted) my view module from dev version to the latest stable version and the error is gone. this might be worth looking in to / post on views issue tracker.
Comment #8
skizzo CreditAttribution: skizzo commentedI am seeing this error and I am not using AF.
This issue may be a duplicate of 1464174
Comment #9
rooby CreditAttribution: rooby commentedYeah, this could be caused by any module, that's why the debugging is useful to find the exact cause.
If changing the views module version fixed it it sounds like a views issue, and the issue skizzo mentions could be what you are after.
Not sure why your debugging isn't working, it could be an error in the debugging code or running out of memory or something.
The dd one should work if you aren't getting errors (aside from the original error), maybe the temp directory has been set to something else at admin/config/media/file-system.
You could try the patch in #1464174: Use of exposed filters causes error: html_entity_decode() expects parameter 1 to be string with the latest views dev and see if it fixes it.
Comment #10
piriya33 CreditAttribution: piriya33 commentedThank you.
Comment #11
troky CreditAttribution: troky commentedMarking this as duplicate of #1464174: Use of exposed filters causes error: html_entity_decode() expects parameter 1 to be string
Comment #12
Chris CharltonComment #13
raviranjan007 CreditAttribution: raviranjan007 as a volunteer and commented1. In the includes/unicode.inc file change this code:
function decode_entities($text) {
return html_entity_decode($text, ENT_QUOTES, 'UTF-8');
}
to this:
function decode_entities($text) {
if(!empty($text)){
return html_entity_decode($text, ENT_QUOTES, 'UTF-8');
}
}