Working on the Commons distribution, I'm seeing the following notice when adding Answer content items, which have ratings attached to them:

Notice: Undefined property: stdClass::$use_source_translation in rate_get_results() (line 479 of /path/to/commons/profiles/commons/modules/contrib/rate/rate.module).

Comments

matt v.’s picture

Version: 7.x-1.6 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new465 bytes

I'm attaching a patch.

jpontani’s picture

Status: Needs review » Needs work

The patch you attached will actually break other Rate widgets as it doesn't actually take into account when the use_source_translation property is set to FALSE (it passes !empty, but shouldn't translated).

See comment #1 in #1905002: adding a new answer results in an undefined property notice when . The problem lies in the rate widget export itself not having that property initialized.

matt v.’s picture

jpontani,

Sorry, I completely missed the patch you posted in #1905002: adding a new answer results in an undefined property notice when . I must not have refreshed the page before posting mine. Thanks for responding so quickly!

Anonymous’s picture

Maybe I'm missing something being new to this, but I've put it both patches, run update.php, and still get the error message twice for the question and each answer. I'm not using commons; I'm using the Answer module and all the required modules that go with it. My version is 7.x-1.6+0-dev.

I may be applying the patch wrong (googled that), or it may be that I should just wait for an updated version. I'm in the beginning stages of the site and this is just one part, so if the answer is wait for a newer version or "You're an idiot," I can deal with that.

Resolved. Yes, I'm an idiot.

msypes’s picture

Issue summary: View changes

Just noting the error still appears in v1.7, but the patch works, or at least in my limited example.

ivnish’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is EOL. Issue will be closed, but patches are still here

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.