Patch (to be ported)
Project:
Userpoints Invite
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 May 2011 at 22:52 UTC
Updated:
30 Aug 2013 at 01:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidThe error message is coming from userpoints_contrib, not token module. Please confirm which version of userpoints_contrib you are using (6.x-1.0-beta1 or 6.x-1.x-dev).
Comment #2
venusrising commentedHey Dave-
Thanks for the reply. Using User Points Contributed modules 6.x-1.0-beta1
Comment #3
venusrising commentedWhen trying to update another module this error now appears again.
Comment #4
venusrising commentedThis error appears again on module update it is generating after module updates. Can someone please give me an idea of where to look, I have no idea what is causing this.
Notice: Constant USERPOINTS_INVITE_REGISTER_INVITER already defined in /home/oursite/html/sites/all/modules/userpoints_contrib/userpoints_invite/userpoints_invite.install on line 5
Notice: Constant USERPOINTS_INVITE_REGISTER_INVITEE already defined in /home/oursite/html/sites/all/modules/userpoints_contrib/userpoints_invite/userpoints_invite.install on line 6
Can someone please advise
Comment #5
venusrising commentedThis error is now popping up when I try to clear the cache form time to time.
Comment #6
gilgabar commentedI'm seeing this too. The error message describes the problem fairly well. A couple of constants are defined twice. Once in userpoints_invite.module and once in userpoints_invite.install. It seems like a pretty gratuitous use of constants anyway, so the best solution might be to not use constants for variable names at all. A simpler solution for now is to just remove the constants from the install file and make the install file load the module file when it runs the function that requires the constants. A patch is attached.
Comment #7
venusrising commented@gilgabar I am not sure how it is under Dev we are actually using 6.x-1.0-beta1 as per #2. Will this work with that too? Is this safe for production as it is our production site that we are seeing this on. Shows up intermittently and on cron run. We do not want this to cause any conflicts with user points and other tie ins like Userpoint badges etc so wanted to clarify.
Thanks for the help!
Comment #8
gilgabar commentedIt isn't any different on the dev version. It should be fine on a production site. That particular piece of code should only ever be run once and then ignored anyway as it is an update. You have most likely already run that update, so it should be of little concern.
Comment #9
venusrising commented@gilgabar Thanks for the help. I will get it applied and report back.
Comment #10
berdirI agree that constants shouldn't be used for this, we tried to remove most of them during the port to 7.x.
Will commit this as soon as someone confirms that this works correctly.
Comment #11
venusrising commentedPatched to production site and updated, all seems well so far. Ran cron too and do not see the error any longer but not to sure how to re-create it as it did happen intermittently.
Comment #12
berdirRemove the whole file, that is a 5.x update function, there is no need for it to exist in 6.x-1.x and that was the only function in that file.
Comment #13
venusrising commented@Berdir I applied patch #6 are you saying this issue should not be handled that way, can you please confirm when you say remove file, can you clarify which file.
Thanks all
Comment #14
venusrising commentedComment #15
craigritchie commentedI just got this for the 7.x-1.0-beta1 version.
Comment #16
simon georges commentedMoved to the right issue queue.
Comment #17
simon georges commentedClosed #1166596: Notice: Constant USERPOINTS_INVITE_REGISTER_INVITER already defined as a duplicate of this one.
Comment #18
tobiberlinStill an issue with current D7 version
Comment #19
dojorob76 commentedsubscribe. Just got the same error messages with D7.
Comment #20
jay.lee.bio commentedSo far I got this notice message just once when I installed the module for D7.
Comment #21
jetwodru commentedencountered the same in D7