Skip to content

Wrong ip value in send friend_log table #30296

Closed
@magento-engcom-team

Description

@magento-engcom-team

Proconditions:

  • Create a product
  • Email to Friend set to "Enabled" in configurations
  • Limit Sending By set to "IP address"
  • Allow for Guests set to "Yes" (not nessesary but if you don't you have create customer before.)

Steps To Reproduce:

  • Go to storfront to the product page
  • Click on send email to friend icon
  • Fill all required fields and click "Send" button
  • Check sendfriend_log table

(/) Expected Result:
Ip value should be converted to biginteger value

(x) Actual Result:
Ip value is not converted properly and it cuted. F.e. If your ip value 127.0.0.1 it will be cutted to 1270.

(!) Notice:
It can cause problems with sendFriend IP validation if different customers will have similar IP addresses

(!) Issue caused by:
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::getRemoteAddress method does not work corectly. Because if it cahced the value one time it will always return cached value despite input parameter

(!)Notice:
Bug blocked this test \Magento\SendFriend\Model\SendFriendTest::testisExceedLimitByIp please unskip after bug fixing

Note from comments:
{quote}Once issue with 'Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::getRemoteAddress' will be fixed please remove ip2long conversion in \Magento\SendFriend\Model\ResourceModel\SendFriend::addSendItem and make sure this case covered with integration tests{quote}

Metadata

Metadata

Assignees

Labels

CDIssue recommended for the contribution dayComponent: OtherFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.3.4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions