Possible candidates:

- _user_relationships_ui_autocomplete_types() (including the relationship type autocomplete)
- user_relationships_ui_get_requestable_rtypes()

Comments

BenK’s picture

Subscribing to help with testing...

mrf’s picture

Status: Active » Needs review
StatusFileSize
new16.14 KB

Here's a first stab at moving these. Tests pass locally, and didn't notice any side effects spending a few minutes clicking through the ui and testing some places these api functions get used.

berdir’s picture

Status: Needs review » Needs work
+++ b/user_relationship_blocks/user_relationship_blocks.moduleundefined
@@ -406,8 +406,8 @@ function template_preprocess_user_relationships_actions_block(&$variables) {
-    $variables['current_relationships'] = _user_relationships_ui_actions_between($user, $account, array('remove' => 1));

Not sure if we should move that one too. Remove the _ and make it a real API function, yes, but if you look at what it returns, it is very much UI related. But I guess it doesn't hurt.

Thanks working on this, I'm currently at the i18n Sprint in Berlin, so I won't have much time for UR this week.

Powered by Dreditor.

mrf’s picture

Status: Needs work » Needs review
StatusFileSize
new10.69 KB

Yeah, I thought that one was a little more generic, but on closer examination its really is only used for a very specific purpose in one place. Would be awesome to eventually provide something similar that is a little more flexible. Moving it back to user_relationships_ui.module for now.

Status: Needs review » Needs work

The last submitted patch, api-move-1136378-4.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review

#4: api-move-1136378-4.patch queued for re-testing.

berdir’s picture

Status: Needs review » Needs work
+++ b/user_relationships_ui/user_relationships_ui.moduleundefined
@@ -126,62 +112,6 @@ function _user_relationships_ui_actions_between($viewer, $viewed, $action_types
@@ -304,11 +234,10 @@ function user_relationships_ui_menu() {

@@ -304,11 +234,10 @@ function user_relationships_ui_menu() {
   $items['relationship_types/autocomplete'] = array(
     'title' => 'User Relationships Autocomplete',
     'type' => MENU_CALLBACK,
-    'page callback' => '_user_relationships_ui_autocomplete_types',
+    'page callback' => 'user_relationships_autocomplete_types',
     'access callback' => 'user_access',

Haven't noticed this before, but it's pretty pointless to move the page callback to the base module but not the hook_menu() entry :)

And when touching that, we might also want to change the path of that. Not sure to what exactly, however. Should it be below admin/ ? Or more something like (user_)relationships/types-autocomplete?

Otherwise, this looks good. We could also postpone the autocomplete part and just commit the other parts for now.

Your call :)

Powered by Dreditor.

mrf’s picture

Status: Needs work » Needs review
StatusFileSize
new12 KB

Here you go, tried to give this an autocomplete a path that we could build off of if we added another autocomplete for something else for some reason down the line.

The default relationship module is the one place that uses this and everything there still works after the move.

berdir’s picture

Status: Needs review » Fixed

Looks good to me, commited!

Status: Fixed » Closed (fixed)

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