Hi all!

I'm trying to configure and use this module in a project. I define a Message type with 3 arguments, then I configure a rule that creates a new message entity and set values for my arguments.

Then I go to "message/example", that is the default message view example, and get an error "Recoverable fatal error: Object of class Message could not be converted to string en DatabaseStatementBase->execute()"

I go to the view and determined that the "Render message (Get text)" handler causes the problem, but I don't know what problem and how to slove this...

It seems that there are a lot of name-matching problems with some modules like Private message, and I'm thinking that it can be the same here...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

milesw’s picture

Title: Recoverable fatal error: Object of class Message could not be converted to string » Conflict with Privatemsg module - "Recoverable fatal error: Object of class Message could not be converted to string"

Ran into the same error trying to render messages in Views. Disabling the Privatemsg module solved the problem for me as well. Thanks for the tip, eidoscom.

Most class names and function names are namespaced properly in both modules. This problem is this...

Privatemsg module:

/**
 * Load a single message.
 */
function privatemsg_message_load($pmid, $account = NULL) {
   ...
}

Message module:

/**
 * Message load.
 */
function message_load($mid) {
   ...
}

It seems Privatemsg is implementing hook_TYPE_load(), which doesn't appear to be a documented hook, but is invoked by the entity controller. So this is a Privatemsg issue. I'll file an issue over there.

milesw’s picture

Status: Active » Closed (works as designed)

Looks like this is known issue, and there's already a patch. :)

#1353342: Private messages and messages not working well together

eidoscom’s picture

Hi here milesw, thanks a lot I will try to apply a patch and test if I can use the two modules together ;)

Michsk’s picture

Applied patch but did not fix it.

bendikrb’s picture

Maybe you've got another module which has a 'message_load' suffix, like I had (messaging_simple.module from the Messaging Framework).
Patch is attached!

eidoscom’s picture

Patch in #5 works for me thanks!!

This patch is commited to Messaging?

dimitriseng’s picture

Status: Closed (works as designed) » Reviewed & tested by the community

I had the same issue when using Commerce and I can confirm that the patch in #5 fixes the issue, thank you!

This patch is for the messaging module and not the message module, should we move this issue to that module's queue? However, messaging does not seem to be very active (only up to alpha2 for D7 and last commit 24 weeks ago...) so not sure how fast that would go it. Is there anything that anybody can do to progress this?

I changed the status back to RTBC so that people can see it and hopefully move it to the messaging module, or maybe we could create a new issue there and close this one. I hope this is ok.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, messaging_1659228_fixing-conflict-with-message-module_5.patch, failed testing.

milesw’s picture

Title: Conflict with Privatemsg module - "Recoverable fatal error: Object of class Message could not be converted to string" » Conflict with Message module - messaging_simple_message_load() inadvertently implements hook_TYPE_load()
Project: Message » Messaging
Status: Needs work » Needs review

The conflict in Privatemsg has been resolved, so we can move this to the Messaging issue queue. I'm assuming the patch here is for 7.x. Changing status to run tests.

milesw’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
631 bytes

Re-submitting patch #5 and changing status back (apparently "reviewed & tested" status also triggers tests).

kurtzhong’s picture

Thanks very much, it saves my day. I am using the message and messaging module on the same site.
But i can't get this patch properly applied using drush make. I rerolled the patch from the messaging root directory rather than from within messaging_simple.

amitaibu’s picture

btw, You can also checkout Message-Subscribe, which is part of the Message stack.

amitaibu’s picture

mpv’s picture

Patch in #11 fixed this issue for me.

DamienMcKenna’s picture

  • Nafes committed 4ff1788 on 7.x-1.x authored by kurtzhong
    Issue #1659228 by milesw, bendikrb, kurtzhong: Conflict with Message...
Nafes’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you, milesw and kurtzhong!

Status: Fixed » Closed (fixed)

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