PHP notices caused by profile.module

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

Fixes errors when submitting the form on user/*/edit/Activity Stream

notice: Undefined index: profile_activitystream_placeholder in /public_html/modules/profile/profile.module on line 436.
notice: Undefined index: profile_activitystream_placeholder in /public_html/modules/profile/profile.module on line 244.

In order to do this I'm using hook_user($op = 'category') to define the "Activity Stream" category for a users account. This removes dependency on profile.module, and still creates the appropriate category for activitystream sub-modules to place their settings fields into.

As such I've also removed the profile.module related code in activitystream.info and activitystream.install

AttachmentSize
actvitystream-remove_profile_dependency.patch2.71 KB

#1

akalsey - July 31, 2008 - 02:56
Status:patch (code needs review)» patch (code needs work)

Beautiful. Getting tabs into the user edit screens was non-obvious, so I used a hack. Your way is WAY better. Ported to 5.x and committed. In addition to your patch, I added an update hook that will delete the useless dummy field.

<?php
/*
  Instead of using the dummy category, we now use hook_user's categories $op switch.
  So we can remove the dummy category from the database.
*/
function activitystream_update_1() {
 
db_query("DELETE FROM {profile_fields} WHERE title = 'Placeholder' and name = 'profile_activitystream_placeholder'");
}
?>

#2

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

Applied to 6.x with the addition from comment #1

#3

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

Drupal is a registered trademark of Dries Buytaert.