[closed] Insert/edit link fails in TinyMCE


#1

I’ve been getting reports from content editors for a little while about the insert link button not working in FarCry (7.1.1). One issue is that because I’ve been busy I was ignoring them which now means I’m not sure at what point in time this problem started (e.g. after a project code change or a FarCry upgrade).

When I (finally) had a look yesterday what I found is that when you click the Insert/edit link button in TinyMCE a request is made like this:

https://xxxxxxxx/webtop/facade/ftajax.cfm?ajaxmode=1&formtool=richtext&typename=dmHTML&fieldname=fc28C4AE20247511E58E8B005056A677D9Body&property=Body&objectid=28C4AE20-2475-11E5-8E8B005056A677D9&action=linkoptions&relatedTypename=dmFile,dmNavigation,dmHTML

But this request is then aborted.

There is no error email generated so I had a dig around in the log files and all I could find was this:

“Information”,“ajp-bio-8012-exec-1”,“07/07/15”,“17:45:57”,“DEVELOP_7”,“Unable to locate webskin [edit] for typename [dmHTML]”

My project doesn’t have a dmHTML edit.cfm webskin so this lead me to have a look in the core at \packages\types\dmHTML.cfc and on line 48 is cfproperty for the dmHTML body which contains

ftLinkListFilterTypenames="dmFile,dmNavigation,dmHTML"

As a test I removed the dmHTML from this list, did an update app and tried again. I can see in the ajax request that dmHTML has been removed from the list but it still fails with an abort. I put dmHTML back and removed dmNavigation but still fail, so tried the same again by removing dmFile. Nothing worked. In the end I completely removed the ftLinkListFilterTypenames and it works!! However obviously this is now the default TinyMCE behaviour and can no longer select from the dmFile,dmNavigation or dmHTML lists.

Anyone got any ideas on where to look for an issue? Anyone else seem similar behaviour in their projects recently after an upgrade?

Regards
Mark


[closed] Timeout for TinyMCE image_farcry plugin needs increasing
#2

The error about being unable to locate the edit webskin for dmHTML is probably unrelated.

I can reproduce the problem locally (did a test on CF9 in fact) and it seems more than a little odd. For me, the first time I click “Insert/edit link” it aborts the request after 2 seconds, but if I click it again straight after the request completes in ~220ms. Clicking cancel in the dialog and then clicking the button again usually also works. But if I leave it for a little while then click the button it will fail again after 2 seconds.

On Railo with the save version of Core, I can’t reproduce the problem at all…

So the requests fail inconsistently and in Adobe CF only?


#3

This is what I was seeing in the network requests in Firebug:


#4

You don’t know how much better that makes me feel knowing you can see the same problem :smile:

I only have ACF so can’t test in Railo/Lucee but for me the errors are consistent, doesn’t matter if I click it again straight away or wait a moment - it always fails

I thought maybe it was some custom edit functions in dmNavigation but I tried removing them and it made no difference.

BTW we are using Adobe CF 10 Standard


#5

As I don’t know when this problem started, I’ve been looking through Git commits for related changes. Any chance this small change could relate to the problem?


#6

Can you see how long the request takes before it gets aborted? Does yours fail after 2 seconds?


#7

Yep 2 seconds with the very occasional 2.01s which I figure is close enough to 2 seconds :smile:


#8

Are you thinking there might be a 2 second timeout limit? All the other requests (e.g. insert image, FarCry templates etc) all complete in less than 2 seconds.


#9

Just so you know, as a test I removed:

    <cfreturn serializeJSON(
getLinkOptions (
stObject=stObj,stMetadata=arguments.stMetadata,relatedtypename=url.relatedtypename
)) />

from richtext.cfc and replaced with:

<cfset test = '[I pasted the serialized data here]'>
<cfreturn test>

(noting I had text that contained single quotes that I had to remove)

And it worked. Also note data returned in 1.19 seconds.


#10

Hmmm… If yours fails every time… Is it due to some JSON prefix settings in the CF Administrator? That setting may need to be turned off?


#11

Nope, the JSON prefix is already turned off:


#12

Found it!

Well that was a complete waste of a day. I found the issue is a timeout setting in

/webtop/thirdparty/tiny_mce/plugins/link_farcry/plugin.min.js

Line 25 sets a timeout of 2 seconds. Increasing this to 5 seconds fixes my issue (script is taking 3.3 seconds to return).

Considering large sites may take a few seconds to build these results, is it worth increasing this for everyone?


#13

Nice spotting :slight_smile: ACF seems to have highly variable response times compared to Railo for some reason, something to do with the JSON serialisation…

I’ll increase this timeout to 10 seconds just to be safer, for p700 and p710.


#14

I’m also going to take a look into why it takes so longer for the JSON data to be built. On that note I’m not seeing the point of the “Web Page” link it creates as it only lists the page your editing - I originally thought maybe anchors would appear here but they don’t. I’m thinking that this part of the query could probably be dropped.


#15

Hmm, I’m not sure about that “Web Page” item in the “Link list” either…

The timeout is now increased to 10 seconds in both p700 and p710.


#16

Thanks Justin! Saves me from needing to remake the change on every upgrade :smile: