PHP Notices on user/*/edit and user/*/edit/Activity Stream

eojthebrave - July 26, 2008 - 18:43
Project:Activity Stream
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

#1

akalsey - July 31, 2008 - 03:00
Status:patch (code needs review)» patch (code 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

akalsey - July 31, 2008 - 17:03
Status:patch (code needs work)» fixed

Applied with my changes from comment 1

#3

akalsey - July 31, 2008 - 17:30
Status:fixed» closed

#4

eojthebrave - August 5, 2008 - 04:18

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.patch813 bytes

#5

eojthebrave - August 5, 2008 - 04:48
Status:closed» patch (code needs review)

Changing status

#6

akalsey - August 5, 2008 - 23:26
Status:patch (code needs review)» fixed

Commited

#7

akalsey - August 16, 2008 - 19:36
Status:fixed» closed

In beta 1

 
 

Drupal is a registered trademark of Dries Buytaert.