Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
25 Jul 2025

Summary of Changes

$limitstart is passed as the second parameter to array_slice(). If $limitstart is null, it triggers the deprecation warning because array_slice() expects an integer for $offset.

Testing Instructions

npx cypress run --spec '.\tests\System\integration\administrator\components\com_installer\'

check php error_log

Actual result BEFORE applying this Pull Request

PHP Deprecated: array_slice(): Passing null to parameter #2 ($offset) of type int is deprecated in administrator\components\com_installer\src\Model\InstallerModel.php on line 129

Expected result AFTER applying this Pull Request

this deprecated entry in the logs is resolved

note: there are other deprecation notices about tobscure see joomla-backports/json-api-php#4

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

avatar brianteeman brianteeman - open - 25 Jul 2025
avatar brianteeman brianteeman - change - 25 Jul 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2025
Category Administration com_installer
avatar brianteeman brianteeman - change - 25 Jul 2025
The description was changed
avatar brianteeman brianteeman - edited - 25 Jul 2025
avatar hans2103
hans2103 - comment - 25 Jul 2025

@brianteeman sorry... Not able to test this.
Haven't worked with Cypres before and I get the followig

$ npx cypress run --spec '.\tests\System\integration\administrator\components\com_installer\'

DevTools listening on ws://127.0.0.1:55037/devtools/browser/14649bfd-0974-426f-b1ff-1fe4e532f79e
Can't run because no spec files were found.

We searched for specs matching this glob pattern:

  > /Users/hans2103/Development/Sites/joomla/public_html/.\tests\System\integration\administrator\components\com_installer\
avatar muhme
muhme - comment - 26 Jul 2025

Haven't worked with Cypres before and I get the followig

@hans2103 Thank you for trying to run Cypress-based System Tests 🚀

  • System Tests are documented in detail in https://github.com/joomla/joomla-cms//blob/HEAD/tests/System
  • Brian has given a directory; to run all test specifications in that directory, you can use a pattern like:
    npx cypress run --spec 'tests/System/integration/administrator/components/com_installer/*.cy.js'
    (And it looks like, you are using an Unix-based system, therefore use slashes / instead of back slashes \)
  • I see old PHP Deprecated: array_slice() entries in my PHP error_log, but I do not see PHP Deprecated: array_slice() from running these two System Tests specifications
  • Also tried to enable Log Deprecated API, but do not see any array_slice deprecation messages in administrator/logs/deprecated.php file

@brianteeman Could you please adjust/extend the test description?

avatar brianteeman
brianteeman - comment - 26 Jul 2025

No idea why you dont see the php error log entries - you should check your php logging and error reporting settings

This was deprecated in php 8.1 https://www.php.net/manual/en/migration81.deprecated.php

You wont see them in the Log Deprecated API log as that is for Joomla deprecations NOT php deprecations

https://www.google.com/search?q=array_slice()%3A+Passing+null&rlz=1C1GCEA_enGB1098GB1098&sourceid=chrome&ie=UTF-8

avatar ceford
ceford - comment - 27 Jul 2025

I have been testing this PR and I get four tests passed.

       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  FromUrl.cy.js                            00:12        2        2        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  Languages.cy.js                          00:02        2        2        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:14        4        4        -        -        -  

However, there is no php error log created. I have tried with php8.3 and php8.4. I know this is something to do with my Apache/PHP installation on Mac but I do not know what. Thinking...


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45778.

avatar muhme
muhme - comment - 28 Jul 2025

However, there is no php error log created.

for my local installation it is:

macOS $ php -i | grep error_log
error_log => /usr/local/var/log/php_errors.log => /usr/local/var/log/php_errors.log

Add a Comment

Login with GitHub to post a comment