HTTP 500 Whoops

Need help upgrading your Joomla! website or converting to Joomla! 5.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

HTTP 500 Whoops

Post by albapets » Sat Apr 13, 2024 5:06 am

Hi,

After update from joomla 4 to 5 and putting "Search Engine Friendly URLs" on this error comes up when users log in

Joomla\Utilities\ArrayHelper::getColumn(): Argument #1 ($array) must be of type array, null given, called in /plugins/content/joomla/src/Extension/Joomla.php on line 331

11.2.3-MariaDB
PHP Version 8.2.14
Apache/2.4.58
Joomla! 5.0.3 Stable

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Sat Apr 13, 2024 6:47 am

You may have uncovered a bug in Joomla. The section of code where the error occurs is related to views of type 'category', 'featured' and 'archive'. If there are articles available in one of those when the user is not logged in all would be well. But if login makes no articles available - for example if article permissions are set to Guest then the error may be triggered.

Can you provide a bit more information? Set Debug System to Yes and Error Reporting to Maximum and then get a full Stack Trace to post here.

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Sat Apr 13, 2024 12:27 pm

I hope this debug page in zip-file helps.
You do not have the required permissions to view the files attached to this post.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Sat Apr 13, 2024 1:33 pm

Please past a screen shot of the stack trace here!

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Sat Apr 13, 2024 1:56 pm

Here..
You do not have the required permissions to view the files attached to this post.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Sun Apr 14, 2024 9:15 am

The stack trace is not really helping. You really need to be able to step through the code to see what is going on. That is not easy if the site is on-line. Do have a desktop/laptop development environment? If not you could try adding a couple of lines to plugins/content/joomla/src/Extension/Joomla.php to bracket line 331:

Code: Select all

\file_put_contents(JPATH_ADMINISTRATOR . '/logs/bugtest.php', $view  . "\n", FILE_APPEND);
                $articleIds = ArrayHelper::getColumn($articles, 'id');
\file_put_contents(JPATH_ADMINISTRATOR . '/logs/bugtest.php', $view  . " worked!\n", FILE_APPEND);
Then look in administrator/logs/bugtest.php - it should show which views are fetching lists of articles and whether they worked. So we look for one that did not work and the next step is to find out why not.

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Sun Apr 14, 2024 12:27 pm

Content of bugtest.php

category
category

Every reload makes 2 lines.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Sun Apr 14, 2024 2:01 pm

Are you logging in via a login module or a menu? What does your login redirect point to?

Can you turn off SEO and see if the browser URL bar contains view=category like this one:

Code: Select all

http://localhost/j5/index.php?option=com_content&view=category&layout=list&id=8&Itemid=132
I just reproduced your error by changing the last number to 133 - an Itemid that does not exist. 132 is the id in the menu table - a menu item I made for a Category blog.

Edit: actually, not exactly your error but one occurring a few lines earlier.

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Sun Apr 14, 2024 3:43 pm

>Are you logging in via a login module or a menu? What does your login redirect point to?
Both ways. Not selected any "Login Redirection Page"
Login actually responds name, profile link etc. After selecting something.. error comes

>Can you turn off SEO and see if the browser URL bar contains view=category like this one:
Yes it does and site works fine.

Yes wrong Itemid gives different error
index.php?option=com_content&view=category&layout=list&id=20&Itemid=X

Call to a member function getParams() on null and Warning Attempt to read property "title" on null in /var/www/html/plugins/content/joomla/src/Extension/Joomla.php on line 319

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Sun Apr 14, 2024 4:32 pm

I research more.
SEF on - When logged in user can see acticles which are set permission registered but not public.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Sun Apr 14, 2024 6:54 pm

What we know is that on line 329 $model->getItems() returns null. I have not found how it can do that. Try this pair of planted lines on either side of line 329:

Code: Select all

\file_put_contents(JPATH_ADMINISTRATOR . '/logs/bugtest.php', $model->option .' ' . $model->name . "\n", FILE_APPEND);
                $articleIds = ArrayHelper::getColumn($articles, 'id');
\file_put_contents(JPATH_ADMINISTRATOR . '/logs/bugtest.php', $view  . " worked!\n", FILE_APPEND);
The lines are not always executed because they are cached. Try login/logout to force something to appear in the bugtest.php file.

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Mon Apr 15, 2024 6:40 am

Now we have 2 lines in that file.
com_content category
com_content category

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Mon Apr 15, 2024 9:36 am

I think the two lines may correspond to the Exceptions [2] and Stack Traces [2] in your screenshot. I am stumped because I can't find anywhere that returns null rather than an empty array. Could you look in your system PHP error log if you have access to it and know where it is. It may contain an error in retrieving the list of articles.

Edit: as a temporary measure you could comment out line 331 and add this on the next line:

Code: Select all

                $articleIds = empty($articles) ? [] : ArrayHelper::getColumn($articles, 'id');
Just to see what you get.

albapets
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Apr 13, 2024 5:00 am

Re: HTTP 500 Whoops

Post by albapets » Mon Apr 15, 2024 1:09 pm

Only line in php log is
PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/libraries/vendor/joomla/application/src/Web/WebClient.php on line 310

And after temporary fix, site comes up with SEF on.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: HTTP 500 Whoops

Post by ceford » Mon Apr 15, 2024 2:09 pm

What do you see in the URL bar after the domain part?

Come back if you have other problems.


Post Reply

Return to “Migrating and Upgrading to Joomla! 5.x”