Skip to content

md5 does not return unique hash value for two objects #28013

@joomdonation

Description

@joomdonation

Steps to reproduce the issue

  1. Add the line of code below under this line https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Form/Field/UsergrouplistField.php#L76
var_dump($hash);
  1. Access to Users -> Manage -> Options. On that page, there are two form fields type usergrouplist, defined here https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_users/config.xml and https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_users/config.xml#L19

Expected result

Two different values of the $hash variable because it's two separate fields

Actual result

For some reasons, the $hash has same values for two fields, thus, the options is cached (options for the second field is always same with options for first field. In my local installation, it has same value d41d8cd98f00b204e9800998ecf8427e

System information (as much as possible)

PHP Version 7.3.11

Additional comments

Maybe use a different function like https://php.net/spl_object_hash or https://www.php.net/manual/en/function.spl-object-id.php

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions