Trying to add a filter based on one-way relationship, similar, I think, to this D6 issue: http://drupal.org/node/455792

AJAX tries to autofill my UR type, but I get this pop up error:

An AJAX HTTP error occured
HTTP Result Code: 200
Debugging information follows.
Path:
http://------.com/admin/views/ajax/autocomplete/user_relationships_type
StatusText:OK
ResponseText:
Fatal error: Call to undefined function drupal_json() in [server path]/sites/all/modules/user_relationships/
user_relationship_views/user_relationships_views.module on line 60

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new842 bytes

Nice catch, please try the attached patch.

craigritchie’s picture

Thanks. The error doesn't appear, but a) the autofill doesn't work until I complete the entire name of the relationship type, and b) when I click 'update,' it just throws this error: "Unable to find relationship type: follow" ('Follow' is the name of my relationship) I also tried changing the 'F' in follow to lowercase, but it still didn't work. So, the autofill kind of finds it, but it's still buggy.

craigritchie’s picture

Just checked my server logs and it shows this: "call to undefined function drupal_json() in ...sites/all/modules/user_relationships/user_relationship_views/user_relationship_views.module on line 60"

BenK’s picture

Subscribing

berdir’s picture

Can you describe what you are exactly doing so that we can reproduce the error?

craigritchie’s picture

Sure... Let me know if this is enough info:

1. I have a one-way relationship I've called "follow" (reciprocal, but not sure what that means at this point, doesn't require approval, never expires)
2. Much like Twitter, for example, I want users to be able to see the content that is generated by people they follow. I need a view that lists, at the very least, the title of content that users they follow have created.
3. When I create/edit the view, I add a filter of "Relationship Type;" "is one of" and type "follow"
4. Autofill now finds the relationship type "follow" but when I choose it and click "Update" (filter) an error says: "Unable to find relationship type: follow"

berdir’s picture

StatusFileSize
new3.34 KB

Ok, there is a serious mess in UR-Views :)

Try this patch, autocomplete and selecting types should now work, there might be other issues but I suggest you mark this as RTBC (if it works) and open new issues for the other things.

BenK’s picture

Status: Needs review » Needs work

I was able to reproduce the error and tested the patch in #7. Yes, the autocomplete and the selecting of types now works.

But I didn't mark this RTBC because there's one other error I noticed: If you go back to edit the filter (by clicking on "User relationships: Relationship type = follow" in the Views UI), then you get the following error message in a popup:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/ajax/config-item/testur/default/filter/rtype
StatusText: Service unavailable (with message)
ResponseText: Recoverable fatal error: Object of class stdClass could not be converted to string in views_handler_filter_user_relationships_type->value_form() (line 19 of /Users/benkaplan/git/drupal-7.0/sites/all/modules/user_relationships/user_relationship_views/views_handler_filter_user_relationships_type.inc).

As a result, you can't edit the filter.

--Ben

P.S. As a side note, I'm not sure about the results actually returned by this view. Perhaps what is needed for the intended use case is a Views relationship. Nevertheless, it's a good catch of errors.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new3.84 KB

Ok, should work now.

BenK’s picture

Status: Needs review » Reviewed & tested by the community

Tested the latest patch and confirmed that all errors are gone and everything seems fixed. This is RTBC.

--Ben

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Commited.

Status: Fixed » Closed (fixed)

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