I receive this error when adjusting the UR block configuration(s):
Notice: Undefined index: size in user_relationship_blocks_block_save() (line 321 of /[...]/sites/all/modules/user_relationships/user_relationship_blocks/user_relationship_blocks.module).
Notice: Undefined index: sort in user_relationship_blocks_block_save() (line 322 of /[...]/sites/all/modules/user_relationships/user_relationship_blocks/user_relationship_blocks.module).
It appears this was an issue during porting to D7 as well, as described in this thread: http://drupal.org/node/671816 (quoted below)
"8. When try to display a block for a one-way relationship--such as "My Relationships: one way friends (Them to You, normal direction)"--I'm getting the following error message shown along with the block:
Notice: Undefined property: stdClass::$sort in template_preprocess_user_relationships_block() (line 371 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/user_relationships/user_relationship_blocks/user_relationship_blocks.module).
Notice: Undefined property: stdClass::$size in template_preprocess_user_relationships_block() (line 377 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/user_relationships/user_relationship_blocks/user_relationship_blocks.module)"
help is always very much appreciated. thanks for the amazing module.
Comments
Comment #1
BerdirThe default values for both are set just a few lines above that:
No idea why you'd get such an error. Do you have these lines?
Comment #2
craigritchie CreditAttribution: craigritchie commentedHere's line 345-379 of /[...]/sites/all/modules/user_relationships/user_relationship_blocks/user_relationship_blocks.module:
/**
* Template pre processor for the main block view
*/
function template_preprocess_user_relationships_block(&$variables) {
$account =& $variables['account'];
$settings =& $variables['settings'];
$extra =& $variables['extra'];
$query_opts = array('include_user_info' => TRUE);
if (empty($settings->sort)) {
$settings->sort = 'newest';
}
if (empty($settings->size)) {
$settings->size = 10;
}
// select the appropriate set of relationships based on admin's configuration settings
switch ($settings->sort) {
case 'newest': $query_opts['order'] = array('changed', 'DESC'); break;
case 'oldest': $query_opts['order'] = array('changed', 'ASC'); break;
case 'random': $query_opts['order'] = 'RAND()'; break;
}
$query_opts['limit'] = $settings->size;
$key = $extra ? ($extra == 'you_to_them' ? 'requester_id' : 'requestee_id') : 'user';
$args = array($key => $account->uid, 'approved' => TRUE);
if ($settings->rtid != UR_BLOCK_ALL_TYPES) {
$args['rtid'] = $settings->rtid;
}
$variables['relationships'] = user_relationships_load($args, $query_opts);
}
Comment #3
klucid CreditAttribution: klucid commentedSame issue here.
Comment #4
drewish CreditAttribution: drewish commentedThe notices from 321 and 322 seem possible but as Berdir the values in template_preprocess_user_relationships_block() are being set and the line numbers 371 and 377 don't correspond to uses of either of those keys. I'd mark the second half of this as cannot reproduce.
Comment #5
matthandI'm getting the same message as well when I save the block configure form for the UR Actions block. I checked and the defaults are referenced as stated in comment #1.
I'm on the dev version: 7.x-1.0-alpha4+12-dev
Any tests I should run? I'll take a look in devel and see what I can find out.
Comment #6
Rafix CreditAttribution: Rafix commentedSame thing here...
Comment #7
de_chris CreditAttribution: de_chris commentedsubscribe:
Notice: Undefined index: size in user_relationship_blocks_block_save() (Zeile 321...
Notice: Undefined index: sort in user_relationship_blocks_block_save() (Zeile 322...
UR version 7.1 alpha5
Comment #8
combait CreditAttribution: combait commentedsame issue
Comment #9
ace11 CreditAttribution: ace11 commentedSame here.
Comment #10
c.breschkow CreditAttribution: c.breschkow commentedI add some code lines after:
Add: