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

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

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?