Jefferson49 / Joomla_plugin_sexypolling_reloaded

Migration of the joomla plugin "Sexy Polling" to joomla 4.x
GNU General Public License v3.0
2 stars 3 forks source link

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

Closed Jfruiz closed 1 year ago

Jfruiz commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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