Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/20/2016 02:54:45 AM (10 years ago)
Author:
boonebgorges
Message:

Activity: After populate(), activity items with a bad ID should have id = 0.

Props jdgrimes.
Fixes #7394.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-activity.php

    r11101 r11312  
    186186                }
    187187
    188                 if ( ! empty( $row ) ) {
    189                         $this->id                = (int) $row->id;
    190                         $this->item_id           = (int) $row->item_id;
    191                         $this->secondary_item_id = (int) $row->secondary_item_id;
    192                         $this->user_id           = (int) $row->user_id;
    193                         $this->primary_link      = $row->primary_link;
    194                         $this->component         = $row->component;
    195                         $this->type              = $row->type;
    196                         $this->action            = $row->action;
    197                         $this->content           = $row->content;
    198                         $this->date_recorded     = $row->date_recorded;
    199                         $this->hide_sitewide     = (int) $row->hide_sitewide;
    200                         $this->mptt_left         = (int) $row->mptt_left;
    201                         $this->mptt_right        = (int) $row->mptt_right;
    202                         $this->is_spam           = (int) $row->is_spam;
    203                 }
     188                if ( empty( $row ) ) {
     189                        $this->id = 0;
     190                        return;
     191                }
     192
     193                $this->id                = (int) $row->id;
     194                $this->item_id           = (int) $row->item_id;
     195                $this->secondary_item_id = (int) $row->secondary_item_id;
     196                $this->user_id           = (int) $row->user_id;
     197                $this->primary_link      = $row->primary_link;
     198                $this->component         = $row->component;
     199                $this->type              = $row->type;
     200                $this->action            = $row->action;
     201                $this->content           = $row->content;
     202                $this->date_recorded     = $row->date_recorded;
     203                $this->hide_sitewide     = (int) $row->hide_sitewide;
     204                $this->mptt_left         = (int) $row->mptt_left;
     205                $this->mptt_right        = (int) $row->mptt_right;
     206                $this->is_spam           = (int) $row->is_spam;
    204207
    205208                // Generate dynamic 'action' when possible.
Note: See TracChangeset for help on using the changeset viewer.