In a D7 site, I have a blog node, and to allow multiple authors, I'm using a user entity reference field (field_source) for blog author instead of the default user. I would like to create an RSS feed of a referenced source's blog content with the URL friendly version of the source's name as a contextual filter (e.g. for user John Smith, the url would be /mysite/feed/john-smith).

Here's what I have so far in my view:

  • Display type = Feed
  • Relationship of "Entity Reference: Referenced Entity - A bridge to the User entity that is referenced via field_source"
  • Contextual filter of field_source with settings of:
    • User validator
    • Allowed filter value of "Allow both numeric UIDs and string usernames" (I've also tried using "Only allow string usernames", but the result is the same).

My problem is, I can get it to work just fine with the uid (e.g. /feed/123), but not the name. Using the name gives no results, and in the Views preview, it says no query was run.

As far as I can tell, I have added everything I should need. What else am I missing?

One option would be to create a URL alias that points to the URL with the numerical value (i.e. mysite/feed/john-smith -> mysite/feed/123), and write some code that auto-generates the alias when a user is created, but that seems like unnecessary extra steps when it seems that according to the UI I should be able to use string values.

Comments

MustangGB’s picture

Status: Active » Closed (outdated)

Closing this as outdated to tidy up a bit around here. If you're still having problems with the latest release please create a new issue.