User tests: Successful: Unsuccessful:
Deprecated: Using null as an array offset is deprecated, use an empty string instead
Open frontend and open login form index.php/component/users/login
deprecation message (possibly further)

no deprecation message about using null as an array offset from AbstractMenu.php
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
why we prove a NULL here.
@HLeithner Did you mean "provide" instead of "prove"?
updated my comment
| Labels |
Added:
bug
PR-5.4-dev
|
||
| Category | Libraries | ⇒ | Libraries Modules Front End |
I would prefere a user deprecation warning
Do you mean something like this. What should the target version be?
/**
* Get menu item by id
*
* @param integer $id The item id
*
* @return MenuItem|null The item object if the ID exists or null if not found
*
* @since 1.5
*/
public function getItem($id)
{
$result = null;
+ if ($id === null) {
+ @trigger_error(\sprintf('The value for $id must not be null in %s', __METHOD__), E_USER_DEPRECATED);
+
+ return $result;
+ }
+
if (isset($this->getMenu()[$id])) {
$result = &$this->getMenu()[$id];
}
return $result;
}and check why we provide a NULL here.
thanks
| Labels |
Added:
PHP 8.x
|
||
✅ Tested with JBT php8.5-rc
| Status | Pending | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-10-16 15:52:35 |
| Closed_By | ⇒ | muhme |
Thank you @heelc29 for your contribution. Thank you @HLeithner for your support.
Strange, based on the method docblock it's not allowed to provide NULL, I would prefere a user deprecation warning and check why we provide a NULL here.