Support

Akeeba Ticket System

#33503 Error message displayed on front end, inconsistent use of JDEBUG

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, 06 September 2020 17:17 CDT

weeblr

Hi,

Just noticed today that we have some warnings displayed on the frontend on our sites by ATS. Saw it on a 404, not on regular pages.

weeblr-2020-08-06-09.12.04.png

After a quick look, this comes from the router which displays a warning when it can't find a menu item linking to Categories (more on that later).

The warning should only be logged unless site debugging is enabled but it's actually displayed. Reason is that the test is:

 if (defined('JDEBUG'))
{
Factory::getApplication()->enqueueMessage($errorMessage, 'warning');
}

The correct test would be just if (JDEBUG) or if (defined('JDEBUG') && JDEBUG) to be on the safe side. You do have a Helper to detect debug mode but it's not always used.

Cheers

Yannick

 

 

 

tampe125
Akeeba Staff

Hello,

 

thank you very much for the report. JDEBUG behavior changed as time passed, this is why we ended up with an helper class to catch all those edge cases.

I just updated the code, you will find the fix in the next version.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi Davide

 

Thanks for that. About "... it can't find a menu item linking to Categories (more on that later).": The reason this is happening is that the router is looking for a menu link going to the all categories ATS page.

However in doing so, it searches for view=Categories.

Problem is, that menu item does exist but was created before you changed FoF to use capitalized views and folders names. So Joomla has the menu item with "...&view=categories".

 

Is this only option to dive into Joomla menu items db table and manually fix? or was it supposed to be fixed during an update but for some reason mine was not updated?

cheers

Yannick

 

tampe125
Akeeba Staff

Views are treated in a case-insensitive way, so it doesn't matter if your view is capitalized or not.

I suspect the problem comes from another source, do you have multiple languages? If so, you have to create a menu entry for each language

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

No, this is at weeblr.com, we do not have multiple languages.

Yannick

 

tampe125
Akeeba Staff

What's the language for the Categories menu entry?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

 

All. Like I said, there never was only one single language installed on that site, en-GB. 100% of menu items are "All" (verified with the search tools). Same for the categories themselves as well as all content articles.

It's indeed likely not the category case causing an issue as the problem remains if I replace

private static $atsHandleViews = [
'Categories', 'Latest', 'My', 'Mies', 'NewTicket', 'Ticket', 'Tickets',
];

with

private static $atsHandleViews = [
'Categories', 'Latest', 'My', 'Mies', 'NewTicket', 'Ticket', 'Tickets',
'categories', 'latest', 'my', 'mies', 'newTicket', 'ticket', 'tickets',
];

 

Cheers

 

tampe125
Akeeba Staff

Ok, I think the easiest solution is to get inside every ATS menu item, click on edit and then select the item type again.

In this way the correct link will be created, fixing your issue.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

Does not change anything. The query in the menu has not changed actually after re-creating it, still showing the exact same query:

weeblr-2020-08-07-11.08.55.png

 

It's happening the same on the staging server so I'll try and debug the code to see why the error is triggered, time-permitting. As long as you come up with a release that hides the message, I can live with that.

Cheers

weeblr

Hi again,

 

At first I only "fixed" the main "Categories" menu link and that had no effect. After the previous post, I reviewed all other ATS menu items and indeed some of them were "damaged" in that their "Menu item type" field was empty - guess it did not match anymore one of the newest menu types.

I re-selected the menu type and saved, doing this for all menu items. All menu items are fixed now, however the warning is still displayed on 404 pages.

Of course, this does not happen when sh404SEF is disabled as the Joomla 404 error page does not display anything.

Best regards

 

tampe125
Akeeba Staff

Good!

You will have to wait for next stable release or manually edit the router.php file, so you can get rid of the warning message.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

Hi

 

Thanks, yes, I did the change in router.php to hide the message.

 

Best regards

 

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!