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

Attempted to load class "IntlTimeZone" from the global namespace. Did you forget a "use" statement? #30

Closed
Jfruiz opened this issue Feb 5, 2023 · 2 comments

Comments

@Jfruiz
Copy link

Jfruiz commented Feb 5, 2023

I just upgrade from Joomla 3.10 to 4 / php 8.0 thinking I will lose this extension and was amazed to find that you "reload" it, thanks.

The install was fine and the admin works (all my polls stay there), but as soon I try to load a module Joomla crash with the above message:

Attempted to load class "IntlTimeZone" from the global namespace.
Did you forget a "use" statement?

Exceptions 2 / Stack Traces 2
Symfony\Component\ErrorHandler\Error
ClassNotFoundError

in D:\Shorted\ServerJ4\www\components\com_sexypolling\helpers\helper.php (line 171)
//load language and timezone
$lang = JFactory::getLanguage();
$lang->load('com_sexypolling');
$lang_tag = $lang->getTag();
$iterator = new ArrayIterator(iterator_to_array(IntlTimeZone::createEnumeration(substr($lang_tag, -2))));
$iterator->rewind();
$time_zone = $iterator->current();
setcookie("sexy_poll_lang_tag", $lang_tag, time()+36060, '/');
setcookie("sexy_poll_time_zone", $time_zone, time()+36060, '/');

Any idea to solve that?
@Jefferson49
Copy link
Owner

Thank you for testing the reloaded plugin!

The IntlTimeZone class should be included in your PHP installation. IntlTimeZone is part of the PHP "intl" extension. If I deactivate the "intl" extension in my installation, I get the same error message.

Can you check your php.ini file, if the "intl" extension is activated. Your php.ini file must contain the following line:
extension=intl

@Jfruiz
Copy link
Author

Jfruiz commented Feb 6, 2023

That is. Now it is working as in 3.10. Thank you very much.

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

No branches or pull requests

2 participants