Closed (fixed)
Project:
Commerce Agree Terms
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2023 at 21:38 UTC
Updated:
17 Apr 2026 at 08:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tonytheferg commentedNot sure if this is overkill, but it sure is cleaner. :)
Comment #3
rohan-sinha commentedReviewed the patch, looks optimized, suggestions
if (!empty($this->getNid())) {
if ($this->getAgreeNode()) {
Instead can be used:
if ((!empty($this->getNid()) && ($this->getAgreeNode())) {
Comment #4
mukesh88 commented#3 suggested code optimized fixed and recreate patch.
Comment #5
mukesh88 commentedComment #6
tonytheferg commentedActually, the
getAgreeNodefunction already checks for nid:So using both would be redundant.
But the
getAgreeNodefunction needs anelsestatement.Comment #7
tonytheferg commentedComment #8
tonytheferg commentedComment #9
tonytheferg commentedActually, I like this better than the else statement:
Comment #10
tonytheferg commentedComment #11
anybodyMight be a good idea to create a MR instead for better comparison?
Comment #14
vitaliyb98 commentedAdded changes from the patch to the MR. Also, merge changes from https://www.drupal.org/project/commerce_agree_terms/issues/3552547, which contains some tests and a pipeline, which will help to validate these changes. Also, it is a good idea to add additional tests.
Comment #15
vitaliyb98 commentedSync code with 2.0.x. LGTM.
Comment #17
vitaliyb98 commentedMerged into 2.0.x