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

Comments

akalsey’s picture

Status: Needs review » 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.

/* 
  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'");
}
akalsey’s picture

Status: Needs work » Fixed

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

akalsey’s picture

Status: Fixed » Closed (fixed)