Problem/Motivation

Error: Call to a member function getDisplayName() on null in Drupal\ultimate_cron\Commands\UltimateCronCommands->unlock() (line 416 of /Users/dieterholvoet/Projects/sites-minsky/hlwt/web/modules/contrib/ultimate_cron/src/Commands/UltimateCronCommands.php)

Steps to reproduce

Run drush cron:unlock <some-unfinished-cron-job-name>.

Proposed resolution

Remove this logging, just after there's Cron job @name unlocked which seems enough to me. The user is always anonymous in Drush context anyway.

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

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Status: Active » Needs review
dieterholvoet’s picture

Anything preventing this from getting merged? Would you rather we keep the warning log?

berdir’s picture

Status: Needs review » Needs work

Indentation seems off?

I'm unsure how much logging we should have, but I'm tempted to just keep it and replace the global user with the current user, much smaller change.

dieterholvoet’s picture

Status: Needs work » Needs review

The current user is always anonymous in Drush context though, so don't think that makes much sense. I fixed the indentation.

berdir’s picture

Status: Needs review » Fixed

That's true, I missed that this code is only about drush and only logs to drush logger, the log entry resume/finish stuff confused me, I thought that was operating on that.

Merging...

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • berdir committed 1b79d7ef on 8.x-2.x authored by dieterholvoet
    fix: #3262872 Call to a member function getDisplayName() on null
    
    By:...

Status: Fixed » Closed (fixed)

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