Skip to content

"x_forwarded_for" value is always empty in Order object. #7227

Closed
@ytorbyk

Description

@ytorbyk

Developer branch used

Preconditions

  1. This scenario i quiet difficult to reproduce since $_SERVER['HTTP_X_FORWARDED_FOR'] must be available.

Steps to reproduce

  1. Place any order

Expected result

  1. "x_forwarded_for" field must contain that value from $_SERVER['HTTP_X_FORWARDED_FOR']

Actual result

  1. "x_forwarded_for" field is always empty

Thoughts

I've tried to find out why it happens.
I found that this field is never set directly to order. It could be copied from quote during conversion quote to order. However quote does't have such field in DB. The field is set to quote each time the quote is got from checkout session.
https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Model/Session.php#L280
But on order placement process quote is got not from session but from DB.
https://github.com/magento/magento2/blob/develop/app/code/Magento/Quote/Model/QuoteManagement.php#L325

Metadata

Metadata

Assignees

Labels

Component: CheckoutEvent: distributed-cdDistributed Contribution DayFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug reportup for grabs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions