Download & Extend

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 (fixed)

Issue Summary

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

AttachmentSize
activitystream-fix_user_edit_notices.patch5.92 KB

Comments

#1

Status:needs review» needs work

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

Status:needs work» fixed

Applied with my changes from comment 1

#3

Status:fixed» closed (fixed)

#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.

AttachmentSize
activitystream-user_edit_errors-287566.patch 813 bytes

#5

Status:closed (fixed)» needs review

Changing status

#6

Status:needs review» fixed

Commited

#7

Status:fixed» closed (fixed)

In beta 1

nobody click here