Questions tagged [deprecated]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
58
votes
4answers
16k views

Deprecated save and load methods in Abstract Model

I see that in the develop branch of the Magento 2 repo the methods load and save from Magento\Framework\Model\AbstractModel class are deprecated. But there are a gazillion classes in the core that ...
32
votes
2answers
3k views

Magento 2 - Why is Magento\Checkout\Model\Cart deprecated?

Since Magento 2.1, Cart has a @deprecated tag. Nevertheless, it is still used by Magento itself to store products when shopping. Is the deprecation intended, and if so, and what should we use instead?
7
votes
2answers
2k views

Magento2.2 getCollection from Factory deprecated

I get in my editor (PhPStorm) on getCollection the message that it is deprecated. In my controller i got the function public function __construct( Registry $registry, ...
6
votes
5answers
20k views

The each() function is deprecated. Magento 2 , php 7.2

I have been getting this error since I changed to PHP-7.2 Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/vedic/vendor/...
6
votes
1answer
540 views

How to replace \Magento\Catalog\Block\Product\Context since it's deprecated?

In a custom module we extend \Magento\Catalog\Block\Product\ListProduct, so we need \Magento\Catalog\Block\Product\Context in our constructor. But as I can see, it has now been marked as deprecated ...
5
votes
4answers
1k views

How to get current product in phtml without registry?

I would like to get my current product in my phtml. I saw lot of examples with registry in the Block file, but now, in M2.3, it's deprecated. Someone have an idea how to do ?
5
votes
3answers
442 views

Save is deprecated when try to create attributes set

I try to create programmatically some attributes set. I find this code : $setup = $this->moduleDataSetup->getConnection(); $setup->startSetup(); $categorySetup = $this->...
4
votes
1answer
1k views

Magento 2 + Reason behind deprecation of payment method class

In payment methods \Magento\Payment\Model\Method\AbstractMethod \Magento\Payment\Model\Method\Cc both are deprecated. In stead to extends both method now as per this link , we should ...
3
votes
3answers
821 views

Magento2 Alternate of Method getCollection() which is deprecated

I have checked the similar post: Magento2.2 getCollection from Factory deprecated But I still don't find the answer of it. I am calling getCollection() function, and PHPStorm saying that this ...
3
votes
1answer
483 views

Magento 1 : each() function is deprecated

In Magento 1, I have been getting this error: Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/test/app/code/core/Mage/Eav/Model/...
3
votes
0answers
28 views

Deprecated Registry alternate using session or any other possibilities for 'Custom module'

In my case, I created Blog Module and in that while getting current_blog_post from URL's id, I register it in coreRegistry and use registry to get the value in various places. register is used in ...
2
votes
2answers
195 views

getResource is deprecated, what is the alternative?

getResource() is deprecated so my question is what do I need to use instead to be future proof for next updates. I use this function like below in the catalog list.phtml $seedBank = $_product->...
2
votes
0answers
418 views

How to load facotry model load best practice?

class Product extends \Magento\Framework\View\Element\Template { protected $_productloader; public function __construct( \Magento\Framework\View\Element\Template\Context $context, ...
2
votes
1answer
162 views

How to load current product in Magento 2 without using deprecated functionality?

The core uses two deprecated classes to load the current product within the block class on the front end: \Magento\Catalog\Block\Product\AbstractProduct \Magento\Framework\Registry See: \Magento\...
1
vote
3answers
445 views

How to get current product in Magento 2.3.1 without deprecations

Not a duplicate question, as the referenced original question uses deprecated classes. I want to get the current product in a Block / Model in Magento 2.3.1. I cannot directly use / inject / extend ...
1
vote
0answers
95 views

Replacement for Cart (M2)

what's the best replace for \Magento\Checkout\Model\Cart $cart since this class Cart is deprecated ?
1
vote
0answers
7k views

REST API is deprecated for versions v2.1 and higher (12)

In the last days i got this error on my magento. Problems are on my checkout/onepage that returning to cart instead of success. I saw that it can be a facebook problem with the upgrade (after 7th aug ...
0
votes
4answers
1k views

Magento 2.3 idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

I have Installed Fresh Magento2.3 php version 7.2.12 . When System try to send any email like order,contact,register customer etc .. . it will through Exception and not sending any email main....
0
votes
2answers
109 views

Registry deprecated in magento 2.3, How to set data without Registry?

I am creating a custom blog, in which I use the \Magento\Framework\Registry and it is deprecated. I searched for solution but I could only find the way to get the data without registry. Is there's ...
0
votes
1answer
68 views

Magento 2 - php 7.2 - The each() function is deprecated in AbstractCollection.php

I am getting below error in Magento 2.1 using PHP 7.2. main.CRITICAL: Exception: Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /...
0
votes
1answer
36 views

Magento 2 - Save deprecated

I try to create programmatically an integration in Magento 2. I follow this tutorial : https://magecomp.com/blog/create-activate-authorize-a-new-integration-programmatically-in-magento-2/ I have ...
0
votes
0answers
513 views

Deprecated functionality: preg_replace()

Trying my instance of Magento on PHP 5.6 because my host is upgrading the server and everything seems to work well besides from this error message. Deprecated functionality: preg_replace(): The /e ...