Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory::getLanguage() is deprecated #37729

Closed
pinochico opened this issue May 3, 2022 · 7 comments
Closed

Factory::getLanguage() is deprecated #37729

pinochico opened this issue May 3, 2022 · 7 comments

Comments

@pinochico
Copy link

Steps to reproduce the issue

Install plugin n3t Debug - https://bitbucket.org/n3t/n3t-debug/downloads/
Setup - Scream - YES

Expected result

Without all deprecated errors :)

Actual result

PHP User Deprecated: Joomla\CMS\Factory::getLanguage() is deprecated. Load the language from the dependency injection container or via Joomla\CMS\Factory::getApplication()->getLanguage(). in .../joomla4.easy.minion.cz/public_html/libraries/src/Factory.php:273

System information (as much as possible)

J4.2.1
PHP7.4.21

Additional comments

Snímek obrazovky 2022-05-03 v 3 27 37

@brianteeman
Copy link
Contributor

it is dprecated for removal in 5.0

@chmst
Copy link
Contributor

chmst commented May 3, 2022

Closing as this is intended.

@chmst chmst closed this as completed May 3, 2022
@rambro
Copy link

rambro commented Jan 14, 2023

Hi all,

So I backed up my RSFormpro! forms from joomla 3.x and restored them them in the joomla 4.x (test site). via the RSFormProl extension. However when I run the form in joomla 4.x (with debug on) I am getting errors like this.

Joomla\CMS\Factory::getLanguage() is deprecated. Load the language from the dependency injection container or via Joomla\CMS\Factory::getApplication()->getLanguage(). 16384

I know previously when going from joomla 3.x to joomla 4.x, I basically had to reinvent the wheel and reproduce stuff manually. Do you think I have to go from scratch and create a new form in joomla 4.x ?

Let me know what you think

Rick Ambrosino

rsformpro error1
rsformpro error2
rsformpro error3
rsformpro error4
rsformpro error5

@ReLater
Copy link
Contributor

ReLater commented Jan 14, 2023

Why don't you disable debug? Or switch it to more silent?

@rambro
Copy link

rambro commented Jan 15, 2023

Hi,

I turned on debug to find out where the errors were with my RSFormPro form that I created. I did turn it off though. I probably am going to create a form from scratch and put all the setting in their from my previous forms that I upload into joomla 4.x from joomal 3.x.

Rick Ambrosino

@joomdonation
Copy link
Contributor

@rambro Creating a new form won't help solving your issue. Better contact RSFormPro developer, ask them to check and solve the issue in their extension.

@ReLater
Copy link
Contributor

ReLater commented Jan 15, 2023

I turned on debug to find out where the errors were with my RSFormPro form

What I meant: You can configure debugging less noisy. If you use for example n3t Debug plugin you can switch off USER_DEPRECATED messages and others. You don't need then Joomla's debug configuration and "Error reporting". At the moment it is a waste of time to debug Joomla inclusive USER_DEPRECATED messages when you are not a developer. Even Joomla Core is throwing hundreds of these messages, e.g. in HTMLHelper. If an extension also wants to support 4.0, 4.1 by promise it is almost pointless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants