?
avatar brianteeman
brianteeman
5 Oct 2020

Perhaps this is my misunderstanding but I assumed that if I enabled "Log Deprecated API" then I would quickly get a log of all deprecated code as I navigate the site. This would enable me to check to see if any extension not explicitly marked as J4 compatible could be safely used on J4 (not using deprecated api) or could be easily edited to be used on j4 (updating the code whenever it was using deprecated code)

This only happens (afaict) if there is a specific code to add a log eg

	/**
	 * Refresh the list of include paths
	 *
	 * @return  self
	 *
	 * @since   3.2
	 *
	 * @deprecated  3.5  Use FileLayout::clearIncludePaths()
	 */
	protected function refreshIncludePaths()
	{
		// Log usage of deprecated function
		\JLog::add(__METHOD__ . '() is deprecated, use FileLayout::clearIncludePaths() instead.', \JLog::WARNING, 'deprecated');

		$this->clearIncludePaths();

		return $this;
	}

However in a few (important) cases there is no logging at all just a comment in the code. How is anyone supposed to know the code is deprecated in this case? Are we expected to read every line of code?

	/**
	 * Is site interface?
	 *
	 * @return  boolean  True if this application is site.
	 *
	 * @since       3.2
	 * @deprecated  4.0 Use isClient('site') instead.
	 */
	public function isSite()
	{
		return $this->isClient('site');
	}

avatar brianteeman brianteeman - open - 5 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 5 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Oct 2020
avatar brianteeman brianteeman - change - 5 Oct 2020
The description was changed
avatar brianteeman brianteeman - edited - 5 Oct 2020
avatar brianteeman
brianteeman - comment - 8 Apr 2021

@zero-24 Isnt this something that really needs to be addressed for 3.10?

avatar Fedik
Fedik - comment - 8 Apr 2021

It makes sense, but I would not add it to isSite/isAdmin() due to performance issue of the deprecated logging,
see #30997 and fix #31143

The methods isSite/isAdmin() is widely used, the logger will explode ?

avatar HLeithner HLeithner - change - 8 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-08 16:20:07
Closed_By HLeithner
avatar HLeithner HLeithner - close - 8 Apr 2021
avatar HLeithner
HLeithner - comment - 8 Apr 2021

No we don't need to do this in 3.10 already done in #30938

Add a Comment

Login with GitHub to post a comment