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

[5.3] undefined array key in table\nested.php #45176

Open
wants to merge 2 commits into
base: 5.3-dev
Choose a base branch
from

Conversation

brianteeman
Copy link
Contributor

@brianteeman brianteeman commented Mar 20, 2025

Summary of Changes

The $segments array is being accessed without first checking if it contains any elements. If $segments is empty, trying to access $segments[0] will trigger the warning. You need to check if the $segments array is not empty before accessing its elements

Testing Instructions

image

Open an article and change the user who created it
Check php error log

and/or code review

Actual result BEFORE applying this Pull Request

PHP Warning: Undefined array key 0 in D:\repos\j51\libraries\src\Table\Nested.php on line 1320

Expected result AFTER applying this Pull Request

no entry in the error-log

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@exlemor
Copy link

exlemor commented Mar 22, 2025

Hi @brianteeman, I have 5.3 beta 3 and I am not able to find that PHP Warning in my error_log, do I need to download/install the nightly Joomla_5.3.0-beta4-dev-Development-Full_Package.zip to be able to test this on my test hosting? (sorry for the stupid question, just want to be able to test this)

@brianteeman
Copy link
Contributor Author

@exlemor you probably need to ensure that php is set to log all errors and warnings
error_reporting=E_ALL

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

Successfully merging this pull request may close these issues.

3 participants