The documenation says the method should return integer or string, however for new entities it returns null.

Issue fork drupal-3340272

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Chi created an issue. See original summary.

royalpinto007 made their first commit to this issue’s fork.

royalpinto007’s picture

Assigned: Unassigned » royalpinto007
Status: Active » Needs work

To fix the return type, we need to make sure that the return value of the method is always an int or a string.
If the return value is not set, we can either set it to a default value (such as 0 or an empty string) or generate a new identifier for the entity.

royalpinto007’s picture

Assigned: royalpinto007 » Unassigned
Status: Needs work » Needs review
cilefen’s picture

Status: Needs review » Needs work

This one is tagged "Documentation" so as I interpret it, the intention was only to change the return type annotation.

royalpinto007’s picture

Status: Needs work » Needs review

Got it, thanks for the review @cliefen.
I have made the required modifications and reverted back my old commit.

cilefen’s picture

Status: Needs review » Reviewed & tested by the community

This LGTM based on what I understand this issue to mean.

kleiton_rodrigues’s picture

RTBC +1

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 663d0d4 and pushed to 10.1.x. Thanks!

  • catch committed 663d0d46 on 10.1.x
    Issue #3340272 by royalpinto007, Chi: Fix return type for...
catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.