I'm experiencing an annoying thingy with Articles Anywhere. When sending an AJAX request to com_ajax, sometimes the JSON response is wrapped in <!-- START: ARTA_COMPONENT --><!-- END: ARTA_COMPONENT --> tags, which interferes with parsing of the response. How do I prevent that?
They are AJAX requests from a JS script.
Currently it's on my local development system, so not publicly accessible.
The weird thing is, that it does not happen with all requests. In fact, most of the time it doesn't happen. It seems it has something to do with the response content.
These are added to mark the component area, which is used later in the rendering process to know what part is the component area and what is outside it (like modules and the rest of the HTML structure).
These tags should get removed in that later stage. But it looks like the rendering process is cut off before it gets there.
I did some more searching and found what causes the problem. The JSON response itself contains an {articles}...{/articles} tag. That is because it is the result of an API call to a translation service. If the text to be translated contains a reserved tag, Articles Anywhere handles it differently then when it doesn't.
I think it would be useful to have a mechanism in place to avoid this behavior. However, it also raises an interesting problem in my translator. Although it can recognize HTML & XML, it does not recognize any other tagging system. Something I guess I must handle on my end, but creative suggestions are very welcome 🙂
Currently it is possible to disable AA on specific components as a security measure. Is it possible to exclude com_ajax responses, and any other AJAX responses like the new J4 web services, from AA evaluation?
I tried that latest dev release. Something has changed, but it did not solve the problem. <!-- START: ARTA_COMPONENT --> has become <!-- START: AA_COMPONENT --> 🙂
Unfortunately (s)ftp access is not really possible. Where do you need it for? If I can provide another means of file system access, would that suffice? Or how about if I send you the plugin for you to install in your own development environment. That would give you complete freedom to investigate anything the way you see fit.
I think this has to do with how you (or Joomla) are exiting the page to return the json.
But if I have the code, I can do some input/output tests to see what the best way forward is to fix this...