• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed  Fatal Error on "Category" pages if they are disabled

Shadab

Well-known member
#1
1. Enable the "Create Pages for Categories" setting, in Admin Panel » Options » Node & Forum List

2. Go to Forum list, and make note of any category URL.

3. Disable the "Create Pages for Categories" setting.

4. Visit the URL you noted down in #2.

Code:
Fatal error: Cannot use object of type XenForo_Link as array
in /library/XenForo/Controller.php on line 513
Example: http://xenforo.com/community/categories/official-forums.1/

EDIT:

Traced it down to XenForo_Route_Prefix_Categories::buildLink() which returns a XenForo_Link object if "categoryOwnPage" option is false. It should return a plain string.
 

Mike

XenForo developer
Staff member
#2
Actually returning a XenForo_Link object is correct - this allows you to return more arbitrary strings (such as just including a hash, or a URL that is outside of XF).

The canonicalization system didn't handle that. It now strval's the string. This fixes this issue and should allow canonicalization to work even if it included a full URL.