PHP Notices on user/*/edit and user/*/edit/Activity Stream
| Project: | Activity Stream |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Cleanup PHP notice errors on
user/*/edit - undefined variable form on line 139
user/*/edit/Activity Stream -
notice: Undefined index: activitystream_delicious_userid in /public_html/sites/all/modules/activitystream/activitystream_delicious/activitystream_delicious.module on line 48.
notice: Undefined index: activitystream_feed_feed in /public_html/sites/all/modules/activitystream/activitystream_feed/activitystream_feed.module on line 62.
notice: Undefined index: activitystream_flickr_userid in /public_html/sites/all/modules/activitystream/activitystream_flickr/activitystream_flickr.module on line 87.
notice: Undefined index: activitystream_lastfm_userid in /public_html/sites/all/modules/activitystream/activitystream_lastfm/activitystream_lastfm.module on line 46.
notice: Undefined index: activitystream_twitter_userid in /public_html/sites/all/modules/activitystream/activitystream_twitter/activitystream_twitter.module on line 52
This patch fixes these notices. Applies against 6.x.2.x-dev
| Attachment | Size |
|---|---|
| activitystream-fix_user_edit_notices.patch | 5.92 KB |

#1
There are some situations where isset on an array key can return true, even if the array key has null values, causing behavior you might not expect. I've updated 5.x to fix these warnings, but I changed the code to use empty() instead...
<?php'#default_value' => empty($edit['activitystream_delicious_userid']) ? '' : $edit['activitystream_delicious_userid'],
?>
#2
Applied with my changes from comment 1
#3
#4
It looks like you missed a line when you re-worked the code. There is still an error on the user/*/edit page.
notice: Undefined variable: form in /sites/all/modules/activitystream/activitystream.module on line 142.
This patch should fix it. Let me know if this patch doesn't work, I'm trying out stgit for patch management, so I'm not 100% sure if this will work.
#5
Changing status
#6
Commited
#7
In beta 1