I am getting a warning as a "Model LSD method save() detected in the loop" when I did MEOP2"

The issue is on below the line


Please anyone can help me to resolve this issue

Thank you in advance

2 Answers 2


LSD comes from load/save/delete as Marius says in his answer here: Magento 2: MassAction Model LSD method delete()

Try to avoid saving data inside a loop

  • Hi @SantiBM Thank you,It's working for me.
    – rakhi
    Jun 4, 2019 at 9:53
  • Great! mark the answer as correct if it was helpful!
    – SantiBM
    Jun 4, 2019 at 10:46

Try to avoid save function inside the loop.

Try the below code

private function saveItem($model, $finalData)

and replace the line $model->setData($finalData)->save(); with

$this->saveItem($model, $finalData);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.