2

Has Zend been finally depreciated?

I'm having issues on Catalog page using an Amasty plugin:

Error: Class 'Zend\Serializer\Serializer' not found in /var/www/php/vendor/amasty/shopby-seo/Helper/Data.php:199

Is there no backwards compatibility?

4 Answers 4

4

That's because Magento removed some laminas packages. You can see the difference between the 2.4.2 version of the composer.json and the 2.4.3 one.

Not sure why they did it tho.

You can fix this by adding the package in your own composer.json, as you did (composer require ...).


Another way


  • without need of laminas-log you can perform to create custom log file in Magneto 2.4.3, write down the following code into your file....

  • if like have a one controller and write down below code into the execute method.


 *below code in my Controller file*

  public function execute()
    {
        $writer = new \Zend_Log_Writer_Stream(BP . '/var/log/custom.log');
        $logger = new \Zend_Log();
        $logger->addWriter($writer);
        $logger->info("Your Message");

    }
12

I guess I was missing laminas/laminas-serializer?

I ran:

composer require laminas/laminas-serializer --no-update
composer update
bin/magento setup:upgrade
rm -rf var/generation var/view_preprocessed/ pub/static/frontend
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush

And the issue was resolved.

Why didn't the laminas-serializer install during the upgrade, I'm still confused.

UPDATE:

looks like laminas-serializer(security only updates) has been replaced by jms/serializer

laminas-serializer seems to work and is backward compatible with Zend packages, but jms/serializer is not compatible with Zend.

Now, I just have to learn how to use it :)

1
  • Worked like a charm!!! +1 made my day :) Apr 19, 2022 at 6:46
0

Absolute legend, I've been banging my head against the wall all morning after eventually managing to upgrade to 2.4.3, and then this happens. Why remove something essential without a compatible replacement?

2
  • Well they do have a replacement, just no information on how to use it or what to replace it with. This change was submarined in 2.4.3 without any notice in the release logs. I call this an "Adobe Effect" - any software that company touches that is not Photoshop / Illustrator is complete trash. I mean honestly - not one release since Magento 1 has been without serious issues. Wait until you figure out that if you turn off Checkout captcha, the checkout doesn't work ;) github.com/magento/magento2/pull/33200 Aug 27, 2021 at 16:31
  • In all fairness code should not be directly calling a concrete implementation for serialisation. You should be injecting \Magento\Framework\Serialize\SerializerInterface and using what is provided for that interface.
    – Craig
    Aug 29, 2021 at 20:34
0
  • without need of lamicans-log you can perform to create custom log file in Magneto 2.4.3, write down the following code into your file....

  • if like have a one controller and write down below code into the execute method.


 *below code in my Controller file*

  public function execute()
    {
        $writer = new \Zend_Log_Writer_Stream(BP . '/var/log/custom.log');
        $logger = new \Zend_Log();
        $logger->addWriter($writer);
        $logger->info("Your Message");

    }

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.