When I try to view messages using any of the modules that display messages, I get a fatal error page returned instead, and the dblogs give me the following error:
Recoverable fatal error: Object of class Message could not be converted to string in DatabaseStatementBase->execute() (line 2139 of /path-to-drupal-folder/includes/database/database.inc).
For example, this happens when I view Activities in RedHen CRM, the Order view in Drupal Commerce with Commerce Backoffice installed, etc. It only happens if the Order, Contact, etc. entity has any Messages associated with it. (If you go to a Contact Activities page, an Order, etc. with no messages, the page displays just fine.)
It also occurs when I manually create a message; for example, using the "order notes" entry form provided by Commerce Backoffice on a Commerce Order: When the message is saved, it returns that same fatal error.
I have looked in Commerce, RedHen, Entity modules issue queues, etc. and can't find an answer. Please note, this error occurs even if Commerce Backoffice is not installed, if RedHen isn't, etc. It appears to occur with any module that uses/posts Messages. I have tried installing and uninstalling Message module multiple times.
This means the Message module is useless and dangerous for our site until we find an answer, and many modules we need to install require the Message module, so I'm hoping there's a quick answer to this problem.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1851478-privatemsg-collision-fix.patch | 589 bytes | kalistos |
Comments
Comment #1
amitaibuDo you have private-messages installed?
Comment #2
somatics CreditAttribution: somatics commentedOh, that's what I forgot to mention! Yes, I did have it installed, but I found the issue about Privatemsg and I uninstalled it and any related modules. I also went into the database and deleted all existing messages, just in case something about them was fundamentally damaged. (I did all this in a development environment, so I could break anything I wanted to).
Even with Privatemsg disabled, I got the exact same results I described with creating and viewing Messages.
Comment #3
amitaibuYou'll have to start from a clean installation, and start adding your modules.
Comment #4
somatics CreditAttribution: somatics commentedSo, there are no other known conflicts with this module other than Privatemsg?
Comment #5
amitaibuThe only one I know off is uuid -- whihc needs to be on the dev version. If it's not that, you'll have to check one by one.
Comment #6
dewolfe001 CreditAttribution: dewolfe001 commentedThis is a dump of the Message object passed to database.inc (like 2139).
In searching for this problem, I have found other database.inc problems. Is this a problem with the Message module or a case of ingestion by the database.inc's execute function?
I looked at a sample of other statements passed into the execute function:
All these are simple arrays and the [:mgid_33] is really over packed so it cannot be parsed. That's the execute() indigestion. And, by passing this into execute(), the Message function causes the indigestion.
Comment #7
dewolfe001 CreditAttribution: dewolfe001 commentedHere's what I think needs to happen:
messaging/messaging_simple/messaging_simple.api ca. line 65 should be passing only an integer into the SELECT statement.
works if you check for the integer:
Comment #8
amitaibuNo Patch
Comment #9
andypostThe collision caused by privatemsg's module api function privatemsg_message_load() which wrongly supposed as hook_ENTITY_TYPE_load()
Related #1704516: Conflicts with other modules
EDIT: suppose it needs changes in privatemsg module or implements a hook_module_implements_alter() to unset this
Comment #10
kalistos CreditAttribution: kalistos commentedHere's a simplest fix
Comment #11
kalistos CreditAttribution: kalistos commentedPatch was about 7.x-1.x
Comment #12
andypostFiled #1860320: Collision with message module - rename privatemsg_message_load
Suppose this change is required because privatemsg has a big user base and it possible to take a time to bikeshed about new function name
Comment #13
kalistos CreditAttribution: kalistos commentedThis problem is known in privatemsg module #1353342: Private messages and messages not working well together.
You can fix this problem using privatemsg module dev version OR using patch #1851478-10: Object of class Message could not be converted to string in DatabaseStatementBase (Private Message integration) OR using patch #1353342-16: Private messages and messages not working well together.
Patch #1851478-10: Object of class Message could not be converted to string in DatabaseStatementBase (Private Message integration) will need to be reverted when new privatemsg stable version will be released.
Comment #14
amitaibuSince #1353342: Private messages and messages not working well together was already committed in Private-message, I don't think Message needs to fix it as-well.
Comment #15
somatics CreditAttribution: somatics commentedI've gotten confused about the progression of this issue: Maybe I'm not understanding some of this, so I hope someone can help clarify this for me:
I reported having this problem, and that it persists even with Private Message disabled. Starting in post 6, dewolfe001 reported some details that indicate the source of the crash in Messages -- and the way I understood it, he was referring to errant behavior of the Messages module itself, not Private Message. Then some fixes were suggested, and then finally Amitaibu concluded that it doesn't need to be fixed because it's already fixed in the Private Messages module.
So, that's where I'm confused: I thought dewolfe001 and many of the follow up posts were referring to problems occurring within Messages module, regardless of interaction with the Private Messages modules. Isn't there a behavior that needs to be corrected in the Messages module itself?
Comment #16
amitaibuClosing as per #14
Comment #17
somatics CreditAttribution: somatics commentedHi,
I would really appreciate an answer to my question, in #15.
Comment #18
amitaibu> and then finally Amitaibu concluded that it doesn't need to be fixed because it's already fixed in the Private Messages module.
Isn't that the answer? :)
Comment #19
somatics CreditAttribution: somatics commentedWell, that's where I'm still confused -- since I'm still encountering the error, even without the Private Messages module enabled (and I thought dewolfe001 was also reporting his errors independent of the Private Messages module).
Thanks for your replies, and in advance for any further clarifications you can provide to me :)
Sorry to be so clueless about this matter.
Comment #20
betz CreditAttribution: betz commentedI can confirm the same problem.
I don't have privatemsg even in my installation, i tried with and without uuid (latest dev).
When i open admin/content/message i get
Recoverable fatal error: Object of class Message could not be converted to string in DatabaseStatementBase->execute() (line 2139 of /www/includes/database/database.inc).
I have locale and entity translation enabled, maybe this has to do something with it?
Tom
Comment #21
betz CreditAttribution: betz commentedreopening, as privatemsg has nothing to do with it.
Comment #22
betz CreditAttribution: betz commentedIn views, i can see the message id's and timestamps, but when i add the rendered message as field, i get an error.
Comment #23
betz CreditAttribution: betz commentedThe changes to messaging module in comment #7 do work for me.
So moving this issue to messaging module...
Comment #24
dewolfe001 CreditAttribution: dewolfe001 commentedLike you, I didn't have PrivateMsg in the mix, so that has nothing to do with the actual issue. There were many reports from different sources about an error at line 2139. The function I made changes to had a problem because the input could not be parsed by function as it was.
Comment #25
somatics CreditAttribution: somatics commentedAny chance there's progress on this?
We are completely unable to use Message module -- and so many other contrib modules are starting to rely on the Message module to provide best functionality. it really is handicapping our site.
Comment #26
amitaibuJust follow what's written in Message's homepage and get Private message --dev version.
Comment #27
somatics CreditAttribution: somatics commentedHi, thanks for the quick response.
Unfortunately, we have been using the latest Dev version of Private Message module since we encountered this problem and filed this issue last November -- yet we have had this problem any time we have tried to use Message.
The current version of the Private Message module we have on our site is 7.x-1.3+10-dev (2013-May-24).
Comment #28
bramface CreditAttribution: bramface commentedAnother vote for #7.
Comment #29
antoinetooley CreditAttribution: antoinetooley commented#7 worked for me. Thanks!
Comment #30
bramface CreditAttribution: bramface commentedGetting this error when viewing a message after applying #7 above:
Messaging_Simple::load()
Warning: array_keys() expects parameter 1 to be array, string given
And am unable to delete the message. So: #7 not ready for prime time yet. Any ideas?
Comment #31
hanksterr7 CreditAttribution: hanksterr7 commented# 7 worked for me. I have 7.x-1.0-alpha2+2-dev installed for messaging and messaging_simple_mail. I do not have Private Message installed.
File to touch was messaging/messaging_simple/messaging_simple.inc (not messaging/messaging_simple/messaging_simple.api as mentioned in #7).