Skip to content

Conversation

@Davnit
Copy link
Member

@Davnit Davnit commented Oct 20, 2018

Several objects with getUser() functions (document, packet, etc) were expecting a null user if the ID wasn't found, but a UserNotFoundException was being thrown instead which prevented some index pages from being displayed.

Adds User::findUserById($id) function to libraries\User. Returns the user object or null. Updates some objects to use this.

Several objects with getUser() functions (document, packet, etc) were expecting a null user if the ID wasn't found, but a UserNotFoundException was being thrown instead which prevented some index pages from being displayed.

Adds User::findUserById($id) function to libraries\User. Returns the user object or null. Updates some objects to use this.
@Davnit Davnit requested a review from carlbennett October 20, 2018 10:13
Instead of having code to show the same comment section in multiple files, centralize it and have the other files include the central file. The file is located in templates\Comment\Section.inc.phtml, which seemed to fit the general pattern.

Before including you should have $comments, $logged_in, $object_id, and $comment_parent_type defined. $comment_parent_type is the constant value from libraries\Comment "Comment::PARENT_TYPE_DOCUMENT" etc.

The new comment section display also handles missing users.
@Davnit Davnit changed the title Actually return null on missing users Better/fixed missing user handling Oct 20, 2018
Copy link
Member

@carlbennett carlbennett left a comment

Choose a reason for hiding this comment

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

Good work so far but minor changes are required.

@carlbennett carlbennett self-assigned this Oct 20, 2018
@carlbennett carlbennett changed the base branch from phoenix to develop October 20, 2018 18:13
Copy link
Member

@carlbennett carlbennett left a comment

Choose a reason for hiding this comment

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

Going to merge these changes into develop instead and fix the minor mistakes.

@carlbennett carlbennett merged commit d4d8720 into BNETDocs:develop Oct 20, 2018
@Davnit Davnit deleted the patch-1 branch October 20, 2018 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants