I have a fresh install of privatemsg and I receive the following warnings when clicking on 'Send this user a private message' link:
Strict warning: Only variables should be passed by reference in _privatemsg_generate_user_array() (line 95 of /opt/lampp/htdocs/xxxxx/sites/all/modules/privatemsg/privatemsg.module).
Sometimes the line number is 88. The 'Messages' page does not show any error or warning, nor when I just click on 'Compose new message' link. The message is sent correctly though.
Can this be related to Tokens module? Because in the page that I get this warning, the "To" field is preloaded with the clicked user name along with token-like entry. It says "User Two [user: user2]".
(where 'User Two' is the user's full name and 'user2' is the userid).
Update:
Looks like the user name displayed in that format may be because of 'Realname' module.
Meanwhile, I've suppressed the warnings by putting the parameters to the 'array_shift' functions in line 88 and 95 into a variable as suggested by the warning message.
Comment | File | Size | Author |
---|---|---|---|
#13 | 1282108-13-privatemsg-strict_warnings.patch | 1.12 KB | pfrenssen |
#12 | 1282108-12-privatemsg-strict_warnings.patch | 1.12 KB | pfrenssen |
#9 | privatemsg-getting_strict_warnings.patch | 1.04 KB | offerman |
Comments
Comment #1
cadius CreditAttribution: cadius commentedI've got this too. What was the code change to fix this?
Comment #2
m2jalali CreditAttribution: m2jalali commented+1
Comment #3
fredfab CreditAttribution: fredfab commentedI've got this too.
Anandkumar said :
"Meanwhile, I've suppressed the warnings by putting the parameters to the 'array_shift' functions in line 88 and 95 into a variable as suggested by the warning message."
It sems to be interesting but I don't know how to do this ?
Someone could help ?
Comment #4
Anandkumar CreditAttribution: Anandkumar commentedHere's what I replaced my line 88 with:
And, these lines replace line 95:
Sorry, no time to create patches.
Comment #5
fredfab CreditAttribution: fredfab commentedThank you Anandkumar! It's perfect.
Comment #6
Edy Gorbacev CreditAttribution: Edy Gorbacev commentedthanks..
almost confused.. but now understand hehehe..
This is in line 95 :
and i replace it with yours:
and i move to line 88.. do the same thing hahaha.. becouse if i replace line 88 first.. than it will make me confuse becouse the line 95 will move to row 97... lol..
Thank you very much..
Comment #7
Berdirmakes sense, can you provide this as a patch?
Comment #8
daniela basualdo CreditAttribution: daniela basualdo commented+1
Comment #9
offerman CreditAttribution: offerman commentedHere's the patch I created from #4.
Comment #10
BerdirComment #12
pfrenssenHere's a proper patch rolled against 7.x-2.x from the change proposed in #4.
Comment #13
pfrenssenAnd here is the same patch rolled against 7.x-1.x.
Comment #14
BerdirThanks, commited both patches.
Comment #16
lachokun CreditAttribution: lachokun commentedI had the same issue there... thanks Anandkumar for the fix! xDDD
Comment #16.0
lachokun CreditAttribution: lachokun commentedAdded and update regarding Realnames.