- Issue created by @tonytheferg
- Status changed to Needs review
almost 2 years ago 9:40pm 3 April 2023 - Status changed to Needs work
almost 2 years ago 3:16am 4 April 2023 - 🇮🇳India rckstr_rohan
Reviewed the patch, looks optimized, suggestions
if (!empty($this->getNid())) {
if ($this->getAgreeNode()) {Instead can be used:
if ((!empty($this->getNid()) && ($this->getAgreeNode())) { - Status changed to Needs review
almost 2 years ago 4:44am 4 April 2023 Actually, the getAgreeNode function already checks for nid:
public function getAgreeNode() { if (!$this->getNid()) { return NULL; } return $this->entityTypeManager->getStorage('node')->load($this->getNid());
But it needs an else statement.
- Status changed to Needs work
almost 2 years ago 10:51am 4 April 2023 - Status changed to Needs review
almost 2 years ago 11:27am 4 April 2023 Actually, I like this better than the else statement:
/** * {@inheritdoc} */ public function getAgreeNode() { $node = NULL; if (!empty($this->getNid())) { $node = $this->entityTypeManager->getStorage('node')->load($this->getNid()); } return $node; }
- 🇩🇪Germany Anybody Porta Westfalica
Might be a good idea to create a MR instead for better comparison?