Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/01/2016 09:00:21 PM (9 years ago)
Author:
r-a-y
Message:

Activity: Introduce error handling to the BP_Activity_Activity class.

To support frontend user messages for activity failures, we need the
ability to add errors.

This commit:

  • Introduces the $errors object and $error_type property to the BP_Activity_Activity class.
  • Adds an 'error_type' parameter to all applicable, activity functions.
  • Modifies bp-legacy to output an error message for activity failures.

See #6719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-functions.php

    r10819 r10858  
    11501150 *
    11511151 * @since 1.2.0
     1152 * @since 2.6.0 Added 'error_type' parameter to $args.
    11521153 *
    11531154 * @param array|string $args {
     
    11691170
    11701171    $defaults = array(
    1171         'content'  => false,
    1172         'user_id'  => bp_loggedin_user_id(),
    1173         'group_id' => 0
     1172        'content'    => false,
     1173        'user_id'    => bp_loggedin_user_id(),
     1174        'group_id'   => 0,
     1175        'error_type' => 'bool'
    11741176    );
    11751177
     
    12121214
    12131215    $activity_id = groups_record_activity( array(
    1214         'user_id' => $user_id,
    1215         'action'  => $action,
    1216         'content' => $content_filtered,
    1217         'type'    => 'activity_update',
    1218         'item_id' => $group_id
     1216        'user_id'    => $user_id,
     1217        'action'     => $action,
     1218        'content'    => $content_filtered,
     1219        'type'       => 'activity_update',
     1220        'item_id'    => $group_id,
     1221        'error_type' => $error_type
    12191222    ) );
    12201223
Note: See TracChangeset for help on using the changeset viewer.