this is causing database error

SELECT activity.aid AS aid, COALESCE( activity_personal_messages.message, activity_messages.message ) AS activity_messages_message, activity.created AS activity_created
FROM activity activity
INNER JOIN activity_targets activity_targets ON activity.aid = activity_targets.aid
AND (
activity_targets.uid =0
)
LIMIT 0 , 30

MySQL said: 

#1054 - Unknown column 'activity_personal_messages.message' in 'field list' 

Comments

Scott Reynolds’s picture

Status: Active » Postponed (maintainer needs more info)

Can you please export your View and attach it to a comment for me ?

timl’s picture

$view = new view;
$view->name = 'zz';
$view->description = 'z';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'activity';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'message' => array(
    'label' => 'Message',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'message',
    'table' => 'activity_messages',
    'field' => 'message',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'zz');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));

timl’s picture

bump, where does this table come from?

it's not in the .install file so this looks like a show stopper

Scott Reynolds’s picture

The table is a alias' table for activity_messages. Its used to pull in the personal message for the currently logged in user.

This is really strange, do you have the most stable Views ?

Scott Reynolds’s picture

Any update? This table is an alias created in activity.views.inc in activity_views_data

// describe the personal targets table so Views knows how to join it in
  // this table will be used to join the activity table to the personal message table
  $data['activity_personal_targets']['table'] = array(
    'group' => t('Activity'),
    'join' => array(
      'activity' => array(
        'type' => 'LEFT',
        'left_field' => 'aid',
        'field' => 'aid',
        'extra' => array(
          array(
            'value' => '***CURRENT_USER***', // grab the personal message
            'numeric' => TRUE,
            'field' => 'uid',
          ),
          array(
            'value' => '***ACTIVITY_LANGUAGE***',
            'field' => 'language',
          ),
        ),
        'table' => 'activity_targets',
      ),
    ),
  );
// create a faux table, that is really activity messages
  $data['activity_personal_messages']['table']['join'] = array(
    'activity' => array(
      'left_table' => 'activity_personal_targets',
      'left_field' => 'amid',
      'field' => 'amid',
      'type' => 'LEFT',
      'table' => 'activity_messages',
    ),
  );
timl’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing this -

I upgraded to the latest 2.x, removed all tables. Removed all old views. Working now!
very excited to start using activities - great to see so much effort still going into it, thank you!