Magento2. Serialize file doest not exists in Magento 2.1.16 versionMagento Extension working in version 2.0 but not working in version 2.1Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPathError with Dependency Injection in widgetMagento 2 API - declare @return JSONError saving an attribute on Magento 2Magento 2.2.0 : Add to cart product error unable to unserialize valueModule works when in app/code but not when in vendor folderGetting EscapeHelper doesnt exist after magento upgrade to 2.2.6Magento 2 module error after version upgradeUnable to Serialize Value Magento 2.2.6

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Force user to remove USB token

Is it true that real estate prices mainly go up?

Is there a window switcher for GNOME that shows the actual window?

What to do when during a meeting client people start to fight (even physically) with each others?

If the Captain's screens are out, does he switch seats with the co-pilot?

The bar has been raised

Single word request: Harming the benefactor

How do I locate a classical quotation?

Good allowance savings plan?

Who deserves to be first and second author? PhD student who collected data, research associate who wrote the paper or supervisor?

PTIJ: Why can't I eat anything?

Unreachable code, but reachable with exception

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Space in array system equations

Should I tell my boss the work he did was worthless

BitNot does not flip bits in the way I expected

What are some noteworthy "mic-drop" moments in math?

Why does Captain Marvel assume the people on this planet know this?

Fourth person (in Slavey language)

PTIJ: How can I halachically kill a vampire?

Replacing Windows 7 security updates with anti-virus?

How could our ancestors have domesticated a solitary predator?

Are babies of evil humanoid species inherently evil?



Magento2. Serialize file doest not exists in Magento 2.1.16 version


Magento Extension working in version 2.0 but not working in version 2.1Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPathError with Dependency Injection in widgetMagento 2 API - declare @return JSONError saving an attribute on Magento 2Magento 2.2.0 : Add to cart product error unable to unserialize valueModule works when in app/code but not when in vendor folderGetting EscapeHelper doesnt exist after magento upgrade to 2.2.6Magento 2 module error after version upgradeUnable to Serialize Value Magento 2.2.6













1















I just complete my module n I was trying to test my module on different versions my module was working perfectly on 2.2.7 and 2.3.0 versions but when I tried on 2.1.16 then it gives me the error




Error filtering template: Class MagentoFrameworkSerializeSerializerJson does not exist




How can I solve this error n what is the reason behind this error










share|improve this question


























    1















    I just complete my module n I was trying to test my module on different versions my module was working perfectly on 2.2.7 and 2.3.0 versions but when I tried on 2.1.16 then it gives me the error




    Error filtering template: Class MagentoFrameworkSerializeSerializerJson does not exist




    How can I solve this error n what is the reason behind this error










    share|improve this question
























      1












      1








      1








      I just complete my module n I was trying to test my module on different versions my module was working perfectly on 2.2.7 and 2.3.0 versions but when I tried on 2.1.16 then it gives me the error




      Error filtering template: Class MagentoFrameworkSerializeSerializerJson does not exist




      How can I solve this error n what is the reason behind this error










      share|improve this question














      I just complete my module n I was trying to test my module on different versions my module was working perfectly on 2.2.7 and 2.3.0 versions but when I tried on 2.1.16 then it gives me the error




      Error filtering template: Class MagentoFrameworkSerializeSerializerJson does not exist




      How can I solve this error n what is the reason behind this error







      magento2 error magento2.1.16






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 11 hours ago









      Asad KhanAsad Khan

      1128




      1128




















          1 Answer
          1






          active

          oldest

          votes


















          0















          The SerializerInterface interface and its implementations only exist since Magento version 2.2.
          Because of this, it is not possible to use these classes in code that has to be compatible with Magento 2.1 or 2.0.
          In code that is compatible with earlier versions of Magento 2, constructor dependency injection can not be used to get an instance of SerializerInterface.
          Instead, a runtime check if the SerializerInterface definition exists can made, and if it does, it can be instantiated by directly accessing the object manager using a static method. Alternatively a check against the Magento 2 version or the magento/framework composer package version would work, too. If the interface does not exist or an earlier version of Magento 2 is being executed, the appropriate native PHP serialization function has to be called, e.g. serialize() or json_encode(), depending on the usercase.




          First, we need to check SerializerInterface class exist. If exist, use object manager to create an object and use it. If not exist, use native PHP function serialize() or json_encode(). Please refer the below code for your reference.



           private function serialize($data)

          if (class_exists(MagentoFrameworkSerializeSerializerInterface::class))
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $serializer = $objectManager->create(MagentoFrameworkSerializeSerializerInterface::class);
          return $serializer->serialize($data);

          return serialize($data);



          Please refer this link for more details.






          share|improve this answer

























          • So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

            – Asad Khan
            10 hours ago











          • check my updated answer.

            – Bilal Usean
            10 hours ago











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f265533%2fmagento2-serialize-file-doest-not-exists-in-magento-2-1-16-version%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0















          The SerializerInterface interface and its implementations only exist since Magento version 2.2.
          Because of this, it is not possible to use these classes in code that has to be compatible with Magento 2.1 or 2.0.
          In code that is compatible with earlier versions of Magento 2, constructor dependency injection can not be used to get an instance of SerializerInterface.
          Instead, a runtime check if the SerializerInterface definition exists can made, and if it does, it can be instantiated by directly accessing the object manager using a static method. Alternatively a check against the Magento 2 version or the magento/framework composer package version would work, too. If the interface does not exist or an earlier version of Magento 2 is being executed, the appropriate native PHP serialization function has to be called, e.g. serialize() or json_encode(), depending on the usercase.




          First, we need to check SerializerInterface class exist. If exist, use object manager to create an object and use it. If not exist, use native PHP function serialize() or json_encode(). Please refer the below code for your reference.



           private function serialize($data)

          if (class_exists(MagentoFrameworkSerializeSerializerInterface::class))
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $serializer = $objectManager->create(MagentoFrameworkSerializeSerializerInterface::class);
          return $serializer->serialize($data);

          return serialize($data);



          Please refer this link for more details.






          share|improve this answer

























          • So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

            – Asad Khan
            10 hours ago











          • check my updated answer.

            – Bilal Usean
            10 hours ago
















          0















          The SerializerInterface interface and its implementations only exist since Magento version 2.2.
          Because of this, it is not possible to use these classes in code that has to be compatible with Magento 2.1 or 2.0.
          In code that is compatible with earlier versions of Magento 2, constructor dependency injection can not be used to get an instance of SerializerInterface.
          Instead, a runtime check if the SerializerInterface definition exists can made, and if it does, it can be instantiated by directly accessing the object manager using a static method. Alternatively a check against the Magento 2 version or the magento/framework composer package version would work, too. If the interface does not exist or an earlier version of Magento 2 is being executed, the appropriate native PHP serialization function has to be called, e.g. serialize() or json_encode(), depending on the usercase.




          First, we need to check SerializerInterface class exist. If exist, use object manager to create an object and use it. If not exist, use native PHP function serialize() or json_encode(). Please refer the below code for your reference.



           private function serialize($data)

          if (class_exists(MagentoFrameworkSerializeSerializerInterface::class))
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $serializer = $objectManager->create(MagentoFrameworkSerializeSerializerInterface::class);
          return $serializer->serialize($data);

          return serialize($data);



          Please refer this link for more details.






          share|improve this answer

























          • So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

            – Asad Khan
            10 hours ago











          • check my updated answer.

            – Bilal Usean
            10 hours ago














          0












          0








          0








          The SerializerInterface interface and its implementations only exist since Magento version 2.2.
          Because of this, it is not possible to use these classes in code that has to be compatible with Magento 2.1 or 2.0.
          In code that is compatible with earlier versions of Magento 2, constructor dependency injection can not be used to get an instance of SerializerInterface.
          Instead, a runtime check if the SerializerInterface definition exists can made, and if it does, it can be instantiated by directly accessing the object manager using a static method. Alternatively a check against the Magento 2 version or the magento/framework composer package version would work, too. If the interface does not exist or an earlier version of Magento 2 is being executed, the appropriate native PHP serialization function has to be called, e.g. serialize() or json_encode(), depending on the usercase.




          First, we need to check SerializerInterface class exist. If exist, use object manager to create an object and use it. If not exist, use native PHP function serialize() or json_encode(). Please refer the below code for your reference.



           private function serialize($data)

          if (class_exists(MagentoFrameworkSerializeSerializerInterface::class))
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $serializer = $objectManager->create(MagentoFrameworkSerializeSerializerInterface::class);
          return $serializer->serialize($data);

          return serialize($data);



          Please refer this link for more details.






          share|improve this answer
















          The SerializerInterface interface and its implementations only exist since Magento version 2.2.
          Because of this, it is not possible to use these classes in code that has to be compatible with Magento 2.1 or 2.0.
          In code that is compatible with earlier versions of Magento 2, constructor dependency injection can not be used to get an instance of SerializerInterface.
          Instead, a runtime check if the SerializerInterface definition exists can made, and if it does, it can be instantiated by directly accessing the object manager using a static method. Alternatively a check against the Magento 2 version or the magento/framework composer package version would work, too. If the interface does not exist or an earlier version of Magento 2 is being executed, the appropriate native PHP serialization function has to be called, e.g. serialize() or json_encode(), depending on the usercase.




          First, we need to check SerializerInterface class exist. If exist, use object manager to create an object and use it. If not exist, use native PHP function serialize() or json_encode(). Please refer the below code for your reference.



           private function serialize($data)

          if (class_exists(MagentoFrameworkSerializeSerializerInterface::class))
          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $serializer = $objectManager->create(MagentoFrameworkSerializeSerializerInterface::class);
          return $serializer->serialize($data);

          return serialize($data);



          Please refer this link for more details.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 10 hours ago

























          answered 10 hours ago









          Bilal UseanBilal Usean

          5,02423690




          5,02423690












          • So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

            – Asad Khan
            10 hours ago











          • check my updated answer.

            – Bilal Usean
            10 hours ago


















          • So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

            – Asad Khan
            10 hours ago











          • check my updated answer.

            – Bilal Usean
            10 hours ago

















          So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

          – Asad Khan
          10 hours ago





          So Brother what is the solution did I need to use two different versions for 2.1.16 and another for 2.2.X or updated versions??

          – Asad Khan
          10 hours ago













          check my updated answer.

          – Bilal Usean
          10 hours ago






          check my updated answer.

          – Bilal Usean
          10 hours ago


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f265533%2fmagento2-serialize-file-doest-not-exists-in-magento-2-1-16-version%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

          Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

          How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2