Questions tagged [deprecated]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
356 views

PHP Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in

PHP Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in "PREPAID_TAXABLE_AMOUNT"=> (($item->getDiscountAmount()) ? abs( round($item->...
Arjun's user avatar
  • 3,556
1 vote
2 answers
58 views

Can anyone suggest how to remove deprecated registry class and what are the alternative methods?

I'm performing an upgrade to Magento 2.4 and the registry class has been deprecated but it's being used in some custom modules, please see the code below: <?php declare(strict_types=1); namespace ...
user8305827's user avatar
1 vote
1 answer
1k views

Deprecated Functionality: Creation of dynamic property $_coreRegistry is deprecated

I am having this issue with magento 2.4.6 custom module and php8.2 This code: public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\...
G. G.'s user avatar
  • 1,122
1 vote
2 answers
174 views

Deprecated Functionality: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated

I am using magento 2.4.6 One of my modules is adding meta tags in catalog. Not my code case 'catalog_product_view': $currentProduct = $this->_registry->registry('...
G. G.'s user avatar
  • 1,122
0 votes
2 answers
543 views

Magento upgrade error 2.4.5 in php 8.1 json_decode(): Passing null to parameter #1 ($json) of type string is deprecated

I am facing after an issue after upgrading version magneto 2.4.2 to 2.4.5 When I run this command I got error json_decode(): Passing null to parameter #1 ($json) of type string is deprecated app/code/...
Ravindrasinh Zala's user avatar
1 vote
0 answers
169 views

Cron Job consumers_runner has an error: Deprecated Functionality: trim(): Passing null to parameter #1 ($string) of type string is deprecated

I have a store in Magento Cloud. There is particular job which is not working properly whenever CRON runs. Please check the error below, Cron Job consumers_runner has an error: Deprecated ...
Sunny Rahevar's user avatar
1 vote
1 answer
85 views

why session_id column from customer_visitor table got deprecated in Magento 2.4 latest versions?

In Magento 2.4.5 installed in my local server i noticed that session_id column from customer_visitor table got deprecated but i can't seem to find any details of documentation for why it got ...
Vishal Rathod's user avatar
2 votes
3 answers
10k views

How to fix str_replce Deprecated Functionality error in magento 2.4.4

Can anyone tell me how to resolve the below error. "Deprecated Functionality: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated" I am using magento 2....
Nicola Smith's user avatar
1 vote
1 answer
716 views

escapeUrl is deprecated?

Can someone help & explain to me what does escapeUrl is deprecated mean? What I need to do for the changes? thanks <?= /* @escapeNotVerified */ $item->getQtyOrdered() ?> x <a href=&...
Paul Fan's user avatar
  • 614
0 votes
2 answers
549 views

Method setFrom is deprecated

Method setFrom is deprecated Declared in Magento\Framework\Mail\Template\TransportBuilder Is there any alternative?
Hafiz Arslan's user avatar
0 votes
1 answer
222 views

Registry & Services

Can Any body explain me Why Magneto used registry and now why we use Services for what purposes instead of Registry.
Rana Zain's user avatar
  • 618
0 votes
1 answer
62 views

How can i overwrite file from vendor so that setup:di:compile won't read it

I have a 3rd party module that is giving some deprecation issues. Is there any way to replace the class that is having problems in my own module in app/code without moving the whole module from vendor?...
user2239352's user avatar
2 votes
1 answer
2k views

Deprecated Functionality: Zend_Http_UserAgent implements the Serializable interface in magento2.4.4

I am facing "Deprecated Functionality: Zend_Http_UserAgent implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize()" Error in magento2.4.4 All ...
Anikesh Shahi's user avatar
2 votes
2 answers
11k views

Magento 2 :- Magento upgrade error 2.4.4 in php 8.1

When i run this command i got error php bin/magento maintenance:enable PHP Deprecated: Return type of phpseclib_mcrypt_filter::filter($in, $out, &$consumed, $closing) should either be ...
Chirag Chikhaliya's user avatar
1 vote
0 answers
239 views

Deprecated functions in Magento 2

There are lots of functions in magento 2 which are deprecated like Registry. Can anyone give me list of such functions or classes.
Tanmay's user avatar
  • 780
2 votes
1 answer
201 views

addNoticeMessage Vs addNotice : how pass URL in message with new function

I wanted to add notice to page with URL $this->messageManager->addNoticeMessage( __( 'Go to my account, <a href="%1"> My account</a>', ...
Vishwas Bhatnagar's user avatar
1 vote
1 answer
4k views

User Deprecated Functionality: Session ID is not used as URL parameter anymore

i get the below error in magento Exception #0 (Exception): User Deprecated Functionality: Session ID is not used as URL parameter anymore. in /var/www/html/magento.loc/vendor/magento/framework/Url.php ...
Mahdi's user avatar
  • 13
0 votes
1 answer
294 views

Method 'delete' is deprecated

phpstorm IDE saing that method 'delete' is deprecated. Is there any alternatives? public function deleteVoucherStatus($entity_id) { $voucherStatus = $this->voucherStatusModelFactory-&...
Andrey Smolin's user avatar
0 votes
1 answer
1k views

Magento 2.3 getResource is deprecated, what is the alternative?

I have a product attribute label get in category page below way. <?php $tablecolor = $_product->getResource()->getAttribute('xyz'); // attribute name $attrTestValue = $tablecolor->...
Rakesh Donga's user avatar
  • 5,324
3 votes
0 answers
104 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 ...
Rajkumar Vellaiswamy's user avatar
2 votes
2 answers
2k 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 ...
Haerriz's user avatar
  • 681
5 votes
2 answers
4k 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->...
Riccardo's user avatar
  • 382
0 votes
1 answer
763 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 /...
user1799722's user avatar
0 votes
1 answer
412 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 ...
Kozame's user avatar
  • 964
3 votes
3 answers
4k 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 ...
Adarsh M's user avatar
  • 562
2 votes
1 answer
779 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\...
bassplayer7's user avatar
  • 2,176
3 votes
3 answers
5k 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 ...
Shoaib Munir's user avatar
  • 9,344
3 votes
1 answer
1k 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/...
Ankita Patel's user avatar
11 votes
7 answers
8k 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 ?
Kozame's user avatar
  • 964
5 votes
3 answers
2k 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->...
Kozame's user avatar
  • 964
1 vote
1 answer
500 views

Replacement for Cart (M2)

what's the best replace for \Magento\Checkout\Model\Cart $cart since this class Cart is deprecated ?
Morgan Tartreau's user avatar
2 votes
8 answers
4k 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....
Abdul Kadir's user avatar
8 votes
5 answers
33k 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/...
Surendra Kumar Ahir's user avatar
8 votes
1 answer
2k 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 ...
tecjam's user avatar
  • 4,033
7 votes
2 answers
3k 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, ...
Johan's user avatar
  • 581
5 votes
1 answer
3k 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 ...
Yogesh's user avatar
  • 1,493
2 votes
0 answers
432 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, ...
Arshad Muhammad's user avatar
1 vote
0 answers
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 ...
Luca DB's user avatar
  • 11
32 votes
2 answers
5k 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?
Patrick van Bergen's user avatar
58 votes
4 answers
26k 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 ...
Marius's user avatar
  • 198k
0 votes
0 answers
686 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 ...
Goose84's user avatar
  • 2,559