Hello,
On J2Commerce 6.6.4 (Joomla 6.1), the content plugin plg_content_j2commerce re-dispatches onContentPrepare at the end of its own onContentPrepare() handler (the “prepare_content” block, src/Extension/J2Commerce.php). It does this for any context, not only for articles or products.
Consequence. When another extension runs content plugins on its own text, every content plugin runs twice. One case we hit: Convert Forms passes the e-mail body of a form submission through HTMLHelper::_('content.prepare', $body, null, 'convertforms.email'), after appending {emailcloak=off}.
- J2Commerce (ordering 0) re-dispatches
onContentPrepare. - Inside that nested dispatch, Joomla’s Email Cloak plugin sees
{emailcloak=off}, removes the marker and does not cloak. - The outer dispatch then reaches Email Cloak (ordering 3) a second time. The marker is gone, so the address gets cloaked.
The notification e-mail then shows “This email address is being protected from spambots…” instead of the sender’s address.
How to reproduce. With J2Commerce’s content plugin enabled (“Prepare Content” = Yes) and Email Cloak enabled, run:
echo HTMLHelper::_('content.prepare', '{emailcloak=off}<a href="https://www.j2commerce.com/mailto:test@example.org">test@example.org<;/a>', null, 'any.context');
The address is cloaked. With the J2Commerce content plugin disabled, it is not.
Expected. The re-dispatch should only run where J2Commerce has rendered something: product/article contexts (com_content.*, com_j2commerce.*), or only when the text actually contained a {j2commerce} shortcode or a product block. An option to list excluded contexts would also do.
There is no workaround through the plugin options. “Prepare Content” = No strips the other plugin tags from our articles ({loadmoduleid}…), and “Preserve Tags” triggers the same re-dispatch.
Thank you!