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

troky’s picture

Status: Active » Closed (works as designed)

It doesn't look like AF problem. includes/unicode.inc is core file.

rooby’s picture

Status: Closed (works as designed) » Postponed (maintainer needs more info)

Just 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:

function decode_entities($text) {
  return html_entity_decode($text, ENT_QUOTES, 'UTF-8');
}

to this:

function decode_entities($text) {
  if (is_array($text)) {
    print_r(debug_backtrace());
  }
  return html_entity_decode($text, ENT_QUOTES, 'UTF-8');
}

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 with dd(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.

piriya33’s picture

I am getting the same problem, will try the debug code and give the result in a minute

piriya33’s picture

This 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?)

rooby’s picture

@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)) {

no drupal_debug.txt showed up in /tmp (root, am I in the right place?)

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.

piriya33’s picture

@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?

piriya33’s picture

I'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.

skizzo’s picture

I am seeing this error and I am not using AF.
This issue may be a duplicate of 1464174

rooby’s picture

Yeah, 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.

piriya33’s picture

Thank you.

troky’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Chris Charlton’s picture

raviranjan007’s picture

1. 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');
}
}