Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 606: Transforming event having userid=0 creates exception fix. #729

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mlynn-lp
Copy link
Contributor

@mlynn-lp mlynn-lp commented Jun 4, 2020

Description

  • Transforming event having userid=0 creates exception fix.

Related Issues

PR Type

  • Fix.

$user = $repo->read_record_by_id('user', $event->userid);

// Get relateduserid or a valid userid for guest.
$userid = $event->userid == 0 && isset($CFG->siteguest) ? $CFG->siteguest : $event->userid;
Copy link
Contributor

@gordonmacqueen-lp gordonmacqueen-lp Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlynn-lp
Can the logic here be extracted out to a utility function?
It could take the config, event and an identifier for the field we are interested in (userid or relateduserid)

This way, it can be reused elsewhere too (like here).

…we get incorrect number of parameters when inserting into the failed log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants