Function redirect_load_by_source returns object, but behind the function is written it returns array of objects:

/**
 * Load multiple URL redirects from the database by {redirect}.source.
 *
 * @param $source
 *   The source of the URL redirect.
 *
 * @return
 *   An array of URL redirect objects indexed by redirect IDs.
 *
 * @see redirect_load_multiple()
 * @see _redirect_uasort()
 * @see redirect_compare_array_recursive()
 *
 * @ingroup redirect_api
 */

And other arguments than $source are not documented yet.

Comments

pere orga’s picture

Status: Active » Needs review
StatusFileSize
new897 bytes

You are right, and I find this function a bit confusing; for some reason is using db_like() to get the redirects, which I guess could load some unwanted redirects.

I'm attaching a patch documenting the current function.

fuzzy76’s picture

Status: Needs review » Reviewed & tested by the community

+1, the new docs checks out

  • Dave Reid committed f28a43f on 7.x-1.x authored by Pere Orga
    Issue #2296035 by Pere Orga: Fixed documentation, especially for...
dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed #1 to 7.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

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