Fixed _buildLink

Robbo

Well-known member
Not so much a bug but your XenForo_ControllerAdmin_Abstract class should overwrite the _buildLink method for consistency.
 
I don't see a problem here:

XenForo_Controller

Rich (BB code):
	/**
	 * If the controller needs to build a link in a type-specific way (when the type isn't
	 * known), this function can be used. As of this writing, only canonicalizePageNumber
	 * uses this function.
	 *
	 * @param string $type
	 * @param mixed $data
	 * @param array $params
	 *
	 * @return string URL for link
	 */
	protected function _buildLink($type, $data = null, array $params = array())
	{
		throw new XenForo_Exception('_buildLink must be overridden in the abstract controller for the specified type.');
	}

According to this description, the abstract controllers only need to override _buildLink if they use canonicalizePageNumber which is currently only used by public controllers. That is why only XenForo_ControllerPublic_Abstract overrides _buildLink. If one of the admin controllers needed to use canonicalizePageNumber then you would have to override _buildLink in the abstract.

I am going to call this "not a bug" and let the devs move it.
 
They say it is what they use it for now, not that is is only meant for that. I assumed like anyone would when that it would work fine in the admin controllers but I got the exception instead. If it was only designed for that one purpose it wouldn't have such a generic name and exception.

It looks to me like it was added late in development for the abstract class to use and then planned to later make use of it. There are many methods on the abstract controllers that don't get used when they could/should.

I agree it is not a bug but I posted it here anyway because suggestion forums seem to get ignored.
 
Hmm... I guess you could argue that it should be defined in case addons want to use it. It can't hurt.

Call it confirmed then. The devs will decide.
 
Top Bottom