I traced the problem down:

Line 64 of user_relationships_api.api.inc

$relationship_type = user_relationships_type_load($relationship_type->rtid);

returns NULL. A new record has just been added to the user_relationship_types table. When user_relationships_type_load tries to give back this record, it calls user_relationships_type_load() which uses a cached version that does not contain the new record.

I'm trying to write a plugin module for user_relationships, but this is blocking me. I have attached this plugin. The symptom is that the added options for user relationship types do not get saved on initial creation, but get saved on future edits.

CommentFileSizeAuthor
user_relationship_unique.zip2.5 KBmtsanford

Comments

mtsanford’s picture

Priority: Critical » Normal
alex.k’s picture

Assigned: Unassigned » alex.k
Status: Active » Fixed

Thanks for noticing this - the error is in user_relationships_ui.admin_actions.inc:64 I believe. A second argument $reset has been added to user_relationships_type_load() similarly to user_relationships_types_load() to force reloading the cache. The hook should fire off with correct data now. The fix has been committed.

Your module looks like it's going to be useful to other people, looking forward to seeing more.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.