Opened 3 years ago

Closed 3 years ago

#12006 closed defect (bug) (fixed)

Comment template functions should accept optional comment ID argument.

Reported by: filosofo Owned by: ryan
Priority: normal Milestone: 3.0
Component: Comments Version: 3.0
Severity: normal Keywords: comments has-patch
Cc:

Description

Otherwise, to get basic comment info you have to define, populate, and reset afterwards a global $comment variable, which is unnecessarily messy.

Patch adds a comment ID variable where helpful and backwards-compatibility safe.

Attachments (2)

comment_ID.argument.12006.diff (9.6 KB) - added by filosofo 3 years ago.
comment_ID.arugment-sans-ternary.12006.diff (8.1 KB) - added by filosofo 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 follow-up: ↓ 2   ryan3 years ago

Since get_comment() returns the global comment if passed on empty ID, can we lose the empty() ternaries?

comment:2 in reply to: ↑ 1   filosofo3 years ago

Replying to ryan:

Since get_comment() returns the global comment if passed on empty ID, can we lose the empty() ternaries?

Absolutely. Second patch drops ternaries.

comment:3   ryan3 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.