EntityOwnerInterface getOwnerId documents wrong return types

Created on 14 June 2021, almost 4 years ago
Updated 27 August 2024, 7 months ago

Problem/Motivation

The documentation gives the incorrect suggestion that user ID are given as integers, when they can be loaded as strings from the database.

Steps to reproduce

Load entity from database, observe string response:

Proposed resolution

Change the phpdoc to reflect the possible types.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Release notes snippet

-

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
User systemย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡จ๐Ÿ‡ญSwitzerland grahl Zรผrich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Seemed last patch had some failures.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine HitchShock Ukraine

    Definitely, this is a major issue, because it can cause mismatching of the result types and can cause mistakes in the conditions.
    For example, a condition like $current_account->id() === $entity->getOwnerId() could be invalid because of type mismatching in the case when it must be valid according to the hin for the function's result type.

    Also, it can cause similar mistakes in the core, for example ๐Ÿ› Media entity owner access check Needs work

    The patch #2 is more valid at the moment I think, so I hide the patch #7.

    The patch #7, in general, is a good idea, but we need to recheck and fix all issues that it will cause, like test failures.

    My opinion is to merge patch #2 ASAP to not confuse developers and to give a correct type hint and create a separate ticket for #7

    Set a ticket to RTB to hurry up the process a bit

  • Status changed to Needs work about 1 year ago
  • The Needs Review Queue Bot โ†’ tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request โ†’ . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

    samit.310@gmail.com โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !92583218667: Fix wrong return types โ†’ (Open) created by samit.310@gmail.com
  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala
  • Pipeline finished with Success
    8 months ago
    Total: 590s
    #258962
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Just wondering, when this returns string and when it returns intvalue. Thinking in the context of why we need have both the return types intand stringalso.

  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    I don't believe it's suppose to return a string, that seems like a bug. Don't think we should update the docs to be wrong to just to cover the bug that's currently there.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Should we cover the bug in this issue itself or create a new one?

Production build 0.71.5 2024