Closed (fixed)
Project:
Legal
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2011 at 07:09 UTC
Updated:
20 Apr 2013 at 18:00 UTC
Jump to comment: Most recent file
I am using the profile2 module and when I edit a profile page and save I get:
Notice: Undefined index: legal_accept in legal_user_update() (line 471 of /var/www/mirp/profiles/mirp/modules/contrib/legal/legal.module).
This is because the legal agreement checkboxes aren't on that page.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | legal-undefined_legal_accept-1370302-21.patch | 743 bytes | maximpodorov |
| #7 | legal-undefined_legal_accept-1370302-7.patch | 706 bytes | rooby |
| #6 | legal_undefined_legal_accept_rooby_schultwin2.patch | 712 bytes | schultetwin |
| #4 | legal_undefined_legal_accept_rooby_schultwin.patch | 839 bytes | schultetwin |
| #2 | legal_module_only_yourself.patch | 831 bytes | schultetwin |
Comments
Comment #1
rooby commentedHere is a patch to fix this.
Comment #2
schultetwin commentedNeed to add another check. This patch should be applied as well.
Comment #3
rooby commentedYou're right, that should be moved.
Although the patch should have the changes in both patches together in one patch.
Comment #4
schultetwin commentedPatch rerolled.
Comment #5
rooby commentedThanks for replying so fast, however I don't think I thought it through properly before.
I am going just by looking at the code at the moment but I think moving that piece of code is not the best idea.
If you are viewing someone else's account you can see the legal field but you cannot edit it (because a user can only agree for themselves). When it comes to save the page and do legal_user_update() those values are in the $edit variable.
So if it isn't the user account for the currently logged in user we want to clear the legal values as you cannot change someone else's legal agreements, which is what all the setting values to NULL is for. So my moving that if statement you are missing that step.
So I'd say this should be left as is, but if you really want it changed you should open a new issue as it would be separate to this one.
This issue should still be solved by the patch in #1.
Comment #6
schultetwin commentedOkay, I can accept that. But the issue is not solved by the first patch, I still received this specific error after applying this patch. This patch should fix it.
Comment #7
rooby commentedAh I see now.
Here is the same patch with a slight change to avoid potential undefined variable messages.
Comment #8
schultetwin commentedAh, much cleaner, thank you.
Comment #9
david387 commentedrooby's patch in comment #7 worked great!
Comment #10
simon georges commentedClosed #1473378: Notice: Undefined index: legal_accept in legal_user_update() (Zeile 470 von /Users/geraldpitschek/Sites/iuk20beta01/sites/all/mo as a duplicate of this issue.
Comment #11
itz_andr3 commentedignore
Comment #12
seworthi commentedPatch in #7 worked great, but I also applied same code to "legal_user_login()" function.
Comment #13
benjf commented#7 works for me also
thanks!
Comment #14
IWasBornToWin commentedHas this patch been committed to the latest dev version?
Comment #15
simon georges commented@IWasBornToWin: no, it hasn't.
Comment #16
robert castelo commentedThanks.
Patch #7 committed to dev
Comment #18
nicolasdiogo commentedsorry for the bad news.
i have just updated my Drupal installation
and it has shown the above error.
drupal - 7.16
regards,
Comment #19
stevieb commentedI also get the error with the update to 7.17
Comment #20
maximpodorov commentedThe same fix as in #7 is required for legal_user_insert() function. Currently, creating users by Rules produces PHP notice:
Notice: Undefined index: legal_accept in legal_user_insert()
Comment #21
maximpodorov commentedThe patch for legal_user_insert() function.
Comment #22
maximpodorov commentedComment #23
d0t15t commentedwas having a similar error - this fixed it!
Comment #24
simon georges commentedComment #25
mrsimonelliott commentedPatch in 21 good for me
Comment #26
spyderpie commentedI have the same issue .. is this in Dev yet?
julie
Comment #27
robert castelo commentedFixed in dev with #21, will include in next release.
Comment #28
spyderpie commentedThank you ;)