Hi.

I have a multilingual site where the comments are opened.

It have some comments, but in their pages sometimes I can see the following message:

Notice: Trying to get property of non-object in entity_translation_query_comment_filter_alter() (line 238 of /home/my-site/public_html/sites/all/modules/entity_translation/entity_translation.node.inc).

The same message also is displayed on the pages of rejected comments and published comments.

In the line 238 of the file entity_translation.node.inc, we have:

if (variable_get("entity_translation_comment_filter_{$node->type}", FALSE)) {

These messages are displayed only to users logged in into the site.

Any ideas?

Tks.

CommentFileSizeAuthor
#1 et-comment_filter_notice-1820910-1.patch698 bytesplach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Needs review
FileSize
698 bytes

What about this?

astutonet’s picture

Thanks to reply.

I remove the line 238 and add the four new lines, as follow:

     if (!empty($node->type) && variable_get("entity_translation_comment_filter_{$node->type}", FALSE)) {
     // Determine alias for "comment" table.
     $comment_alias = FALSE;
     foreach ($query->getTables() as $table) {

After that, the site down and I can see the following message:

Parse error: syntax error, unexpected $end in /home/my-site/public_html/sites/all/modules/entity_translation/entity_translation.node.inc on line 245

I think I'm wrong...

Tks.

bforchhammer’s picture

@astutonet: sounds like you made a mistake applying the patch; have you seen http://drupal.org/node/534548?

astutonet’s picture

Hi @bforchhammer.

Yes, I read the tutorial to Apply Patches Manually. It's that I've seen other new code than existing in the current version and I thought I should add it.

In any case, it seems that only replace the line 238 solves the issue.

If there are new problems I'll report here. For now, thank you.

plach’s picture

Status: Needs review » Reviewed & tested by the community
plach’s picture

Title: Variable GET in line 238 of entity_translation.node.inc file » Notices when trying to filter comments by language
Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 71c28e5 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions by plach:
    Issue #1820910 by plach | astutonet: Fixed Notices when trying to filter...

  • Commit 71c28e5 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench by plach:
    Issue #1820910 by plach | astutonet: Fixed Notices when trying to filter...