When running drush `drush secrev` return exception

TypeError: Drupal\security_review\SecurityReview::getServerUid(): Return value must be of type int,
null returned in Drupal\security_review\SecurityReview->getServerUid()

It was fixed by making the return type of function mixed int and null.

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:

    1 hidden branch
  • 3451581-get-server-uid Comparecompare

Comments

MahmoudSayed96 created an issue. See original summary.

MahmoudSayed96 changed the visibility of the branch 3451581-get-server-uid to hidden.

mahmoudsayed96’s picture

Issue summary: View changes
StatusFileSize
new519 bytes
smustgrave’s picture

Should probably figure out why it's return null before updating.

c-logemann’s picture

@smustgrave The null comes from a cli check with empty return on setServerData().

As pointed out on duplicate issue I suggest to return a posix compatible "-1" so we don't need to extend the type. See MR on #3454915: [error] TypeError: Drupal\security_review\SecurityReview::getServerUid(): Return value must be of type int, null returned.

  • smustgrave committed ae0fad8d on 3.0.x
    Issue #3451581 by MahmoudSayed96, C-Logemann: Get server uid function...
smustgrave’s picture

Status: Active » Fixed

Took the solution from the dup and went with that. Will include with next release shortly.

Status: Fixed » Closed (fixed)

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