Support

Akeeba Ticket System

#34578 Fatal error in mailfetch cron

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by on Sunday, 21 March 2021 20:17 CDT

weeblr

Hi

Since yesterday afternoon, my logs are filling up with the error below upon each execution of the mailfetch cron.

The error does not make much sense, or rather I don't see why it would suddently appear out of nowhere:

 

Akeeba Ticket System -- CRON Script
Copyright 2011-2021 Akeeba Ltd
===============================================================================
Executing “mailfetch” CRON task.
Tip: Use the --verbose command line switch to follow its progress.
********** ERROR! **********
Argument 3 passed to FOF30\Utils\CacheCleaner::clearCacheGroupJoomla3() must be an instance of Joomla\CMS\Application\CMSApplication, instance of ATSCron given, called in /var/www/weeblr.com/www/
public/libraries/fof30/Utils/CacheCleaner.php on line 111
Technical information:
Code: 0
File: /var/www/weeblr.com/www/public/libraries/fof30/Utils/CacheCleaner.php
Line: 152
Stack Trace:
#0 /var/www/weeblr.com/www/public/libraries/fof30/Utils/CacheCleaner.php(111): FOF30\Utils\CacheCleaner::clearCacheGroupJoomla3('_system', 1, Object(ATSCron))
#1 /var/www/weeblr.com/www/public/administrator/components/com_ats/Helper/PluginParameters.php(174): FOF30\Utils\CacheCleaner::clearCacheGroups(Array, Array)
#2 /var/www/weeblr.com/www/public/plugins/ats/mailfetch/library/Horde.php(901): Akeeba\TicketSystem\Admin\Helper\PluginParameters::savePluginParams('mailfetch', Object(Joomla\Registry\Registry))
#3 /var/www/weeblr.com/www/public/plugins/ats/mailfetch/library/Horde.php(199): Akeeba\TicketSystem\MailFetch\Horde->checkGMailLogin()
#4 /var/www/weeblr.com/www/public/plugins/ats/mailfetch/library/EmailCheck.php(262): Akeeba\TicketSystem\MailFetch\Horde->__construct(Array)
#5 /var/www/weeblr.com/www/public/plugins/ats/mailfetch/library/EmailCheck.php(144): Akeeba\TicketSystem\MailFetch\EmailCheck->getMailbox()
#6 /var/www/weeblr.com/www/public/plugins/ats/mailfetch/mailfetch.php(101): Akeeba\TicketSystem\MailFetch\EmailCheck->checkEmail(Object(FOF30\Timer\Timer))
#7 /var/www/weeblr.com/www/public/libraries/joomla/event/event.php(70): plgAtsMailfetch->onAtsCronTask('mailfetch', Array)
#8 /var/www/weeblr.com/www/public/libraries/joomla/event/dispatcher.php(160): JEvent->update(Array)
#9 /var/www/weeblr.com/www/public/libraries/fof30/Platform/Joomla/Platform.php(531): JEventDispatcher->trigger('onatscrontask', Array)
#10 /var/www/weeblr.com/www/public/components/com_ats/Model/Cron.php(141): FOF30\Platform\Joomla\Platform->runPlugins('onAtsCronTask', Array)
#11 /var/www/weeblr.com/www/public/cli/ats-cron.php(203): Akeeba\TicketSystem\Site\Model\Cron->run('mailfetch', 86400)
#12 /var/www/weeblr.com/www/public/libraries/src/Application/CliApplication.php(143): ATSCron->doExecute()
#13 /var/www/weeblr.com/www/public/cli/ats-cron.php(357): Joomla\CMS\Application\CliApplication->execute()
#14 {main}

 

1 - I have not cheched where in the process the error happens. Are the message still fetched, ie the error happens at the end of the processing?

2 - Any hint as to what would cause this?

 

Cheers

 

Yannick

 

nicholas
Akeeba Staff
Manager

Install the latest version of FOF 3 from https://www.akeeba.com/download/fof3/3-7-3.html  I believe you've hit an issue I had fixed in that version.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

 

Will that be part of the next version of ATS?

 

 

weeblr

Hi

 

Installed, same result. Your fof changelog says "CacheCleaner" for Joomla 4 was broken, but this is Joomla 3.

 

nicholas
Akeeba Staff
Manager

You are right, I fixed it after I released FOF 3.7.3. I am publishing FOF 3.7.4 right now which includes just this fix. Please download it from our Downloads page.

The next version for all of our software will be released around March 6th, give or take 2 days. They are all written against a new version of FOF and FEF. Your template overrides should still work. You can and should update them eventually. I have removed all onclick / onchange inline event attributes with JavaScript handlers attached by deferred JavaScript files for better performance and compatibility with stricter content security policy headers.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

Your template overrides should still work

 

Hope so, I was hit by that last time, you removed 'Akeeba\TicketSystem\Admin\Helper\Html::getManagerAssignDropdown()' and that killed one of my template overrides, causing a fatal error on the site for most ATS pages...

I'll report back after installing 3.7.4

 

weeblr

Hi

 

That fixed it.

nicholas
Akeeba Staff
Manager

Thank you for the feedback!

So far I've not run into any issues with my template overrides and I have not touched the helpers. I have changed the JavaScript files and added a few IDs where it made more sense (as opposed to spending a lot of main thread time running complex queryAllBySelector queries) BUT the new JavaScript is written in a way that simply ignores the elements it can't find.

The new JavaScript should be very solid. It's built on top of the work we had already been doing since 2019 on Akeeba Backup and Akeeba Ticket System. We were introducing small changes in each version (after a big initial refactoring) and haven't had any issues reported by anyone so far about it.

I'm trying really hard not to break things by making changes for change's shake. The JavaScript changes are necessary given that Joomla 4 introduced Content Security Policy features. When you enable them you can choose settings which kill all inline event handlers (including the ones Joomla is still using for the toolbar buttons, but let's not get into that...). I know that people will do that so I'm pre-empting their bug reports. I mean, people are already sending me "bug" reports because minor things break in every Joomla 4 beta. You know how it is...

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

 

Well maybe the original template override was from along time ago, but it did was using Akeeba\TicketSystem\Admin\Helper\Html::getManagerAssignDropdown(), and so it broke when I updated to 3.52 (I think) a few weeks ago, causing the fatal error. I checked the helper and it did not have that method so it was indeed removed at some point but again, I can't say from which time exactly the override is.

As for CSP, this can indeed be a source of problems. I have never really use inlined handler though but I'm sure something will break...

 

nicholas
Akeeba Staff
Manager

This helper method was removed in 3.5.0. The reason was that hardcoded HTML in helper classes could not be overridden, as I imagine you had discovered. For people who, like you, are trying to style ATS to match their template this was a roadblock.

Several methods were removed from the Html helper class and moved to overridable view templates:

  • Html::getStatusClass, use admin:com_ats/Common/TicketStatus
  • Html::getPostOriginIcon, use admin:com_ats/Common/TicketOrigin
  • Html::decodeStatus (was not used)
  • Html::getManagerAssignDropdown, use admin:com_ats/Common/ManagerAssignDropdown
  • Html::getTicketStatusDropdown, use admin:com_ats/Common/TicketStatusDropdown
  • Html::loadposition (relic from the FOF 2.x days), use @loadmodules
  • Html::modalChooseUser (we had already migrated to a common template)
  • Html::ordering (relic from before FEF)

There is a further small cleanup of the common templates in version 4.0.0. Some of the common Blade templates used in ATS were also used in other extensions. Now they have been moved to FOF itself. When upgrading to 4.0.0 please test on a local / development site first. You might have to make a few small changes in your overrides, depending on how much you're overriding.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!