Skip to content

Tier price removal in CRON job using wrong website context #36931

Open
@NORDCOMPCZ

Description

@NORDCOMPCZ

Preconditions and environment

M2.4.1

ScopedTierPrice (on this line) calls getWebsiteId aiming to get current website of the context of currently running application. If you run this from CRON the website ID ends up with 0 (as there is Admin set as fallback) and the current removal throws exception. The mentioned line should consider the current tierPrice website and use it as a context.

Steps to reproduce

Price scope set to website

  1. run code from CRON
  2. fetch list of tier prices for any product
  3. try to remove them with scoped tier management

Expected result

Tier price is removed

Actual result

Exception is thrown stating given tier price doesn't exist (which is actually correct - tier price for website ID 0 normally really doesn't exit)

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: CronIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReported on 2.4.1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions