Wrong media URL in WYSIWYG editor when adding images in various Magento store viewsWrong URL returned by WYSIWYG editor for imagesMagento 1.8.1.0 WYSIWYG editor is not displaying thumbnails in image managerURL returned by WYSIWYG is wrongSkin directive doesn't work in WYSIWYG editor when using custom templateMagento Insert Image on WYSIWYG editor does not show imagesImages are not showing in WYISWYG editorMagento 2 WYSIWYG Media image directive using admin url*Not browse images* WYSIWYG editor not showing images properlyBroken images on the front-end when uploaded through WYSIWYG or WidgetsIssue with “Insert Image” or “Insert Link” in WYSIWYG editor on catalog product pagesAdding 'insert images' button to WYSIWYG editor for category default attribute 'description' / remove setting from ui xml file

Does Latin have any neuter words for humans?

Is there reliable evidence that depleted uranium from the 1999 NATO bombing is causing cancer in Serbia?

Movie with Zoltar in a trailer park named Paradise and a boy playing a video game then being recruited by aliens to fight in space

What's the safest way to inform a new user of their password on an invite-only website?

Thin wall to block LED light from hitting photodiode?

Is it okay to fade a human face just to create some space to place important content over it?

Converting Geographic Coordinates into Lambert2008 coordinates

Can European countries bypass the EU and make their own individual trade deal with the U.S.?

Sharing referee/AE report online to point out a grievous error in refereeing

How is this practical and very old scene shot?

Can you actually break an FPGA by programming it wrong?

Why would anyone even use a Portkey?

Most elegant way to write a one-shot 'if'

Comment traduire « That screams X »

How did researchers find articles before the Internet and the computer era?

What game is this character in the Pixels movie from?

Bin Packing with Relational Penalization

Just graduated with a master’s degree, but I internalised nothing

How could a satellite follow earth around the sun while staying outside of earth's orbit?

Adjective for 'made of pus' or 'corrupted by pus' or something of something of pus

Word ending in "-ine" for rat-like

Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

My colleague is constantly blaming me for his errors

Why was Mal so quick to drop Bester in favour of Kaylee?



Wrong media URL in WYSIWYG editor when adding images in various Magento store views


Wrong URL returned by WYSIWYG editor for imagesMagento 1.8.1.0 WYSIWYG editor is not displaying thumbnails in image managerURL returned by WYSIWYG is wrongSkin directive doesn't work in WYSIWYG editor when using custom templateMagento Insert Image on WYSIWYG editor does not show imagesImages are not showing in WYISWYG editorMagento 2 WYSIWYG Media image directive using admin url*Not browse images* WYSIWYG editor not showing images properlyBroken images on the front-end when uploaded through WYSIWYG or WidgetsIssue with “Insert Image” or “Insert Link” in WYSIWYG editor on catalog product pagesAdding 'insert images' button to WYSIWYG editor for category default attribute 'description' / remove setting from ui xml file






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I will try to explain a strange behavior (maybe bug) when using WYSIWYG editor in Magento 1.9.



Magento setup



One website with three store views. Each store view is on different domains. For this case let’s focus only on two storeviews:



storeview 1: mywebshop.eu
storeview 2: mywebshop.it



Steps for reproducing the error.



SCENARIO 1 which is OK.



  1. Open desired product, and open WYSIWYG for description field. Select storeview 1 (english)


  2. Add an image (using the editor’s button Insert/Edit image).


  3. The Html code I get is ok like this:



img src="media url="wysiwyg/adobe-pdf-icon-02.png"" /




The image is corectly displayed in frontend like this:





SCENARIO 2 which is not OK.



  1. RE-Open the same desired product and open WYSIWYG for description field. (Now select store view 2 (Italian)


  2. Add an image (using the editor’s button Insert/Edit image).


  3. Now the code I get is like this:



img src="media url="https://mywebshop.it/media/wysiwyg/adobe-pdf-icon-02.png"" /




The image in frontend is broken, because the HTML output is like this:





RESULT: the image is not displayed because of malformed img src.



We have recently setup Magento that each store view has a different domain. (Maybe this affects).



I saw very similar question here --> Wrong URL returned by WYSIWYG editor for images



But this answer doesn't help/work (Wrong URL returned by WYSIWYG editor for images)



Please help.










share|improve this question






























    1















    I will try to explain a strange behavior (maybe bug) when using WYSIWYG editor in Magento 1.9.



    Magento setup



    One website with three store views. Each store view is on different domains. For this case let’s focus only on two storeviews:



    storeview 1: mywebshop.eu
    storeview 2: mywebshop.it



    Steps for reproducing the error.



    SCENARIO 1 which is OK.



    1. Open desired product, and open WYSIWYG for description field. Select storeview 1 (english)


    2. Add an image (using the editor’s button Insert/Edit image).


    3. The Html code I get is ok like this:



    img src="media url="wysiwyg/adobe-pdf-icon-02.png"" /




    The image is corectly displayed in frontend like this:





    SCENARIO 2 which is not OK.



    1. RE-Open the same desired product and open WYSIWYG for description field. (Now select store view 2 (Italian)


    2. Add an image (using the editor’s button Insert/Edit image).


    3. Now the code I get is like this:



    img src="media url="https://mywebshop.it/media/wysiwyg/adobe-pdf-icon-02.png"" /




    The image in frontend is broken, because the HTML output is like this:





    RESULT: the image is not displayed because of malformed img src.



    We have recently setup Magento that each store view has a different domain. (Maybe this affects).



    I saw very similar question here --> Wrong URL returned by WYSIWYG editor for images



    But this answer doesn't help/work (Wrong URL returned by WYSIWYG editor for images)



    Please help.










    share|improve this question


























      1












      1








      1








      I will try to explain a strange behavior (maybe bug) when using WYSIWYG editor in Magento 1.9.



      Magento setup



      One website with three store views. Each store view is on different domains. For this case let’s focus only on two storeviews:



      storeview 1: mywebshop.eu
      storeview 2: mywebshop.it



      Steps for reproducing the error.



      SCENARIO 1 which is OK.



      1. Open desired product, and open WYSIWYG for description field. Select storeview 1 (english)


      2. Add an image (using the editor’s button Insert/Edit image).


      3. The Html code I get is ok like this:



      img src="media url="wysiwyg/adobe-pdf-icon-02.png"" /




      The image is corectly displayed in frontend like this:





      SCENARIO 2 which is not OK.



      1. RE-Open the same desired product and open WYSIWYG for description field. (Now select store view 2 (Italian)


      2. Add an image (using the editor’s button Insert/Edit image).


      3. Now the code I get is like this:



      img src="media url="https://mywebshop.it/media/wysiwyg/adobe-pdf-icon-02.png"" /




      The image in frontend is broken, because the HTML output is like this:





      RESULT: the image is not displayed because of malformed img src.



      We have recently setup Magento that each store view has a different domain. (Maybe this affects).



      I saw very similar question here --> Wrong URL returned by WYSIWYG editor for images



      But this answer doesn't help/work (Wrong URL returned by WYSIWYG editor for images)



      Please help.










      share|improve this question
















      I will try to explain a strange behavior (maybe bug) when using WYSIWYG editor in Magento 1.9.



      Magento setup



      One website with three store views. Each store view is on different domains. For this case let’s focus only on two storeviews:



      storeview 1: mywebshop.eu
      storeview 2: mywebshop.it



      Steps for reproducing the error.



      SCENARIO 1 which is OK.



      1. Open desired product, and open WYSIWYG for description field. Select storeview 1 (english)


      2. Add an image (using the editor’s button Insert/Edit image).


      3. The Html code I get is ok like this:



      img src="media url="wysiwyg/adobe-pdf-icon-02.png"" /




      The image is corectly displayed in frontend like this:





      SCENARIO 2 which is not OK.



      1. RE-Open the same desired product and open WYSIWYG for description field. (Now select store view 2 (Italian)


      2. Add an image (using the editor’s button Insert/Edit image).


      3. Now the code I get is like this:



      img src="media url="https://mywebshop.it/media/wysiwyg/adobe-pdf-icon-02.png"" /




      The image in frontend is broken, because the HTML output is like this:





      RESULT: the image is not displayed because of malformed img src.



      We have recently setup Magento that each store view has a different domain. (Maybe this affects).



      I saw very similar question here --> Wrong URL returned by WYSIWYG editor for images



      But this answer doesn't help/work (Wrong URL returned by WYSIWYG editor for images)



      Please help.







      magento-1.9 image wysiwyg media






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 21 at 6:36









      Shorabh

      9675 silver badges15 bronze badges




      9675 silver badges15 bronze badges










      asked Jun 20 at 11:21









      TheAgentTheAgent

      84 bronze badges




      84 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Option - 1



          Open or extend (Overwrite) app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php file and update getImageHtmlDeclaration function.



          Replace below code



          $mediaPath = str_replace(Mage::getBaseUrl('media'), '', $fileurl);



          To



          $mediaPath = str_replace(mage::app()->getStore($this->_storeId)->getBaseUrl('media'), '', $fileurl);



          Option - 2



          Go to System > Configuration > Content Management (Under General) > WYSIWYG Options



          Use Static URLs for Media Content in WYSIWYG for Catalog – Select “No”



          I hope it will help you






          share|improve this answer

























          • I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

            – TheAgent
            Jun 20 at 12:30











          • UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

            – TheAgent
            Jun 20 at 14:16












          • Please accept answer

            – Shorabh
            Jun 21 at 4:51













          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%2f279021%2fwrong-media-url-in-wysiwyg-editor-when-adding-images-in-various-magento-store-vi%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














          Option - 1



          Open or extend (Overwrite) app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php file and update getImageHtmlDeclaration function.



          Replace below code



          $mediaPath = str_replace(Mage::getBaseUrl('media'), '', $fileurl);



          To



          $mediaPath = str_replace(mage::app()->getStore($this->_storeId)->getBaseUrl('media'), '', $fileurl);



          Option - 2



          Go to System > Configuration > Content Management (Under General) > WYSIWYG Options



          Use Static URLs for Media Content in WYSIWYG for Catalog – Select “No”



          I hope it will help you






          share|improve this answer

























          • I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

            – TheAgent
            Jun 20 at 12:30











          • UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

            – TheAgent
            Jun 20 at 14:16












          • Please accept answer

            – Shorabh
            Jun 21 at 4:51















          0














          Option - 1



          Open or extend (Overwrite) app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php file and update getImageHtmlDeclaration function.



          Replace below code



          $mediaPath = str_replace(Mage::getBaseUrl('media'), '', $fileurl);



          To



          $mediaPath = str_replace(mage::app()->getStore($this->_storeId)->getBaseUrl('media'), '', $fileurl);



          Option - 2



          Go to System > Configuration > Content Management (Under General) > WYSIWYG Options



          Use Static URLs for Media Content in WYSIWYG for Catalog – Select “No”



          I hope it will help you






          share|improve this answer

























          • I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

            – TheAgent
            Jun 20 at 12:30











          • UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

            – TheAgent
            Jun 20 at 14:16












          • Please accept answer

            – Shorabh
            Jun 21 at 4:51













          0












          0








          0







          Option - 1



          Open or extend (Overwrite) app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php file and update getImageHtmlDeclaration function.



          Replace below code



          $mediaPath = str_replace(Mage::getBaseUrl('media'), '', $fileurl);



          To



          $mediaPath = str_replace(mage::app()->getStore($this->_storeId)->getBaseUrl('media'), '', $fileurl);



          Option - 2



          Go to System > Configuration > Content Management (Under General) > WYSIWYG Options



          Use Static URLs for Media Content in WYSIWYG for Catalog – Select “No”



          I hope it will help you






          share|improve this answer















          Option - 1



          Open or extend (Overwrite) app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php file and update getImageHtmlDeclaration function.



          Replace below code



          $mediaPath = str_replace(Mage::getBaseUrl('media'), '', $fileurl);



          To



          $mediaPath = str_replace(mage::app()->getStore($this->_storeId)->getBaseUrl('media'), '', $fileurl);



          Option - 2



          Go to System > Configuration > Content Management (Under General) > WYSIWYG Options



          Use Static URLs for Media Content in WYSIWYG for Catalog – Select “No”



          I hope it will help you







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 21 at 4:47

























          answered Jun 20 at 11:57









          ShorabhShorabh

          9675 silver badges15 bronze badges




          9675 silver badges15 bronze badges












          • I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

            – TheAgent
            Jun 20 at 12:30











          • UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

            – TheAgent
            Jun 20 at 14:16












          • Please accept answer

            – Shorabh
            Jun 21 at 4:51

















          • I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

            – TheAgent
            Jun 20 at 12:30











          • UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

            – TheAgent
            Jun 20 at 14:16












          • Please accept answer

            – Shorabh
            Jun 21 at 4:51
















          I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

          – TheAgent
          Jun 20 at 12:30





          I already tried option1, but it doesn't work ... maybe I missing something. Option 2 is not ok beacuse we want to to create a new website in the future and I believe this will create some problems ...

          – TheAgent
          Jun 20 at 12:30













          UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

          – TheAgent
          Jun 20 at 14:16






          UPDATE: Option 1 actualy resolves the issue. I just had the the class Mage_Cms_Helper_Wysiwyg_Images extended in another module... Thank you!!

          – TheAgent
          Jun 20 at 14:16














          Please accept answer

          – Shorabh
          Jun 21 at 4:51





          Please accept answer

          – Shorabh
          Jun 21 at 4:51

















          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%2f279021%2fwrong-media-url-in-wysiwyg-editor-when-adding-images-in-various-magento-store-vi%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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Get RecordId in LWC From Community PageLWC Community recordId undefinedhow to get Personal Access Token from my integrated application LWC. I am using js onlylwc quick action from Opportunity page(aura:component) and not getting @api recordIdLWC Community recordId undefinedLWC - How to get label name of buttonsLWC: Add a region in custom community themeVisual force page redirection from lightning communityLWC NavigationMixin does not work in CommunityInvoking LWC component from a plain URL - Read URL Parameter inside LWCLWC download PDF fileLWC Get Pick-list Field Values