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


Well-known member
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.

Fatal error: Cannot use object of type XenForo_Link as array
in /library/XenForo/Controller.php on line 513


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.


XenForo developer
Staff member
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.