Search
Other Articles Anywhere questions
Forum

<!-- START: ARTA_COMPONENT --> JSON response <!-- END: ARTA_COMPONENT -->

Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Hi,

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?
Peter van Westen's Avatar Peter van Westen ADMIN
Is this on Joomla 3 or 4?
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Hey Peter,

I'm sorry for not providing enough info. It's Joomla 4.1.4 with Article Anywhere 12.4.0 PRO.
Peter van Westen's Avatar Peter van Westen ADMIN
Are these ajax requests from a specific extension?
And tell me on what url I can see/reproduce the issue.
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
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.
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
The latest dev version doesn't make a difference.
Peter van Westen's Avatar Peter van Westen ADMIN
If you can reproduce this on an online environment to which I can get access, I am happy to look into this.
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
I will do that as soon as I can.

In the mean time indulge me and explain what those tags are for and why they can not simply be suppressed.
Peter van Westen's Avatar Peter van Westen ADMIN
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.
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
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 🙂
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
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?
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases

It should now show the Ajax Interface in the 'Disable Components' list.
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
I tried that latest dev release. Something has changed, but it did not solve the problem. <!-- START: ARTA_COMPONENT --> has become <!-- START: AA_COMPONENT --> 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
If you want me to see if I can figure it out (why it is happening and if I can solve it on my end), let me know if you can reproduce it online...
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
I'm preparing a demo site to show the translator plugin coming Monday on jug010. After that I will give you access.
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
Please find all needed info in the confidential section.

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Can you also give me (s)ftp access so I can take a deeper look?
Please post a rating at the Joomla! Extensions Directory
Pieter-Jan de Vries's Avatar Pieter-Jan de Vries
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.
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, you can send me the plugin.

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...
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription