TinyMCE insert image not working - tinymce

There are a few similar questions on SO, but none explain the problem I am having.
I am using TomatoCMS hosted on 1and1.
The problem I am having is with:
tinyMCE.getInstanceById('content').execCommand('mceInsertContent', false, '<img src="' + url + '" alt="" />');
Where url could be http://example.com/uploads/123.jpg
The image is correctly inserted into the tinymce preview area, however the content of the original textarea is set to:
<img src="%5C" alt="\"\"" />
This therefore what is saved to the database.
Does anyone have a solution for this?

This is caused by PHP Magic Quotes.
To solve, place a php.ini file in the root of the website containing:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
I found this solution in a post about another software package hosting on 1and1. How to install Precurio on 1and1 servers

I am not perfectly sure, what goes wrong here, but i guess it might have to do with the encoding. You may try the configuration settings provided for this: http://www.tinymce.com/wiki.php/Configuration:entity_encoding

Related

TYPO3 RTE Editor not loading

Today in one of our older sites we found an issue with the RTE Editor. For any of our users the editor does not load. It is stuck on loading as you can see in the image below.
Now I realize that the version we are using for TYPO3 is extremely outdated, the version is 4.5 support has been gone for ages and I wouldn't dare to just update this site.
We haven't updated or changed anything in the configuration so this wouldn't be the case. I've also tried to remove all caches from the site, create a new user and give them all rights and trying several different computers. None of this has helped fix the issue.
Wondering if anyone has a idea on where to search or how to solve this.
Are you using Chrome 73 as browser? This version breaks the rtehtmlarea integration. You need to backport the patch which is provided for TYPO3 8.7.
File: typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
Line : 2224
search for:
src: Ext.isGecko ? 'javascript:void(0);' : (Ext.isWebKit ? 'javascript: '' + HTMLArea.htmlEncode(this.config.documentType + this.config.blankDocument) + ''' : HTMLArea.editorUrl + 'popups/blank.html')
change to:
src: Ext.isGecko ? 'javascript:void(0);' : (Ext.isWebKit ? (Ext.isChrome ? 'about:blank;' : 'javascript: '' + HTMLArea.htmlEncode(this.config.documentType + this.config.blankDocument) + ''') : HTMLArea.editorUrl + 'popups/blank.html')
You probably have a javascript error which stops execution of further javascript.
on loading the data is adapted (from TYPO3 format to HTML) and the editor is build by modifying the DOM. As browsers change in behaviour and javascript engine the old javascript might run into errors with current browsers.
You could try to use another browser.
Otherwise you could disable the RTE in the user settings, although it means you have to edit text as HTML source.

umbraco tiny mce absolute urls

i'm having a issue on tiny mce on umbraco 6.
When i add a image or link on tinymce the urls are converted from
http://domainx.com/images/someimage.png
to
domainx.com/images/someimage.png
i've added a few configurations to tinyMceConfig.config
<config key="relative_urls">false</config>
<config key="convert_urls">false</config>
<config key="remove_script_host">false</config>
but now url's are created without the http or https wich results in wrong path and we can't see the images on the tinymce.
Did you configure any hostname on any node? If so, add the missing part.
What you are describing is a function of TinyMCE and not Umbraco itself. I don't have enough "Rep" to comment, otherwise I would ask what version of TinyMCE is installed/running in your version of Umbraco.
However, while it would appear as though you are on the correct path with your configurations, the documentation (http://wiki.moxiecode.com/index.php/TinyMCE:FAQ) says you need to simply add "convert_urls = false" to the customConfig section of tinyMceConfig.config (like below), the Umbraco community appears to be reporting it as a bug (http://issues.umbraco.org/issue/U4-374).
<customConfig>
<config key="convert_urls">false</config>
...
</customConfig>
Have you tried using //www.example.com rather than http://www.example.com as a possible workaround?
It is possible to do custom configuration settings for TinyMCE in umbraco (documentation).
I couldn't find a correct documentation for changing settings, which are of the type boolean, to false.
After a while and changing some settings I needed, i've found a way to do it! Just leave the value empty in the customConfig-section:
<customConfig>
<config key="convert_urls"></config>
</customConfig>
This resulted in being able to enter (almost) anything as a link, without it being converted.

disabled javascript in content type form: no javascript

I have a problem in my drupal installation..in the content type page i can't drag and drop lines and i see two columns :weight and parent :image1
The problem had application on the content add form like that: image2
If there any configuration to add or to remove or any help to provide i will be very grateful
Thanks
Sorry..
It seemed to be a server configuration problem.. i uploaded a 'virgin' drupal installation to my remote server ( the producton erver) and i installed without any supplement module, just the core modules with the 777 permission for all the files..but the same problem persist ..I'm suspecting the php version that i' m using (5.2.17 instead of 5.3.10)

zend headScript()->appendFile in IE (internet explorer)

Two lines of script
$this->headScript()->appendFile('/js/global.js', 'text/javascript');
$this->headScript()->appendFile('http://zendbase/js/global.js', 'text/javascript');
Firefox runs script by both ways(absolute, root relative)
Internet Explorer only run the Second method of append(absolute), which is with http. which is not a good way.
when I view source in browser I can see following line is added
<script type="text/javascript" src="/js/global.js"></script>
But browser is not reading. it is really beyond my understanding. It is strange. How can I make first line to work with document root path on all browsers including IE.
Is there any settings in view helper? or something else?
I can use $_Server variables to make it absolute dynamically but i don't want to use absolute path.
Any Idea. Thanks in advance :)
Relative paths for scripts will definitely work with IE - I have used it numerous times... What is the hostname you are using (e.g. www.example.com)? Your second line of code should not work, because you don't have a valid hostname - http://zendbase won't resolve to anything. Is zendbase a variable?
For relative static assets (images, JS, CSS, SWF, etc), you should always use the baseUrl helper, eg
$this->headScript()
->appendFile($this->baseUrl('/js/global.js'));
If you can see the correct <script> tag in source, then the problem is either the path is incorrect (see baseUrl helper above) or your JavaScript contains errors.
Finally I fixed the problem
I removed the baseUrl(); ?>" /> from layout.phtml
and added following line in application.ini
resources.frontController.baseUrl = ""

CMS pages do not displaying images in admin panel

I have a weird problem with magento cms module.
All the CMS pages on the frontend are displaying images correctly, but images are not displaying on the admin cms editor page. It just displays 'X' image broken icon.
I actually don't know where to start to fix this issue.
Any one had similar issue?
If in frontend you have the file http://yourdomain.com/media/your_file.jpg which renders perfectly, when editing the content in backend that file is linked through smtg like http://yourdomain.com/index.php/admin/cms_wysiwyg/directive/key/b9f80b36bc860a90ea2a03b61a6babfa/___directive/e3ttZWRpYSB1cmw9InBvd2RlcnNfOTB4OTAuanBnIn19/ and this image is broken.
The problem is that in Mage_Adminhtml_Cms_WysiwygController (Mage/Adminhtml/controllers/Cms/WysiwygController.php) method directiveAction the $url is ... an url (of course) instead of an image path which is what we need in this case.
You can create a module that overwrites the directiveAction and you would need to replace the $url assignment to
$url = BP . str_replace(Mage::app()->getStore()->getConfig('web/unsecure/base_url'),"/", Mage::getModel('core/email_template_filter')->filter($directive) );
hope that works for you,
Ky.
Try changing the following in your admin :
System -> Configuration -> General -> Content Management -> Use Static URLs for Media Content in WYSIWYG for Catalog to Yes
This setting is present in 1.7.0.2 at least.