Adobe Experience Manager: Experience Fragment (XF) copy and paste operation fails with Error popup

Description description

When you copy and paste an Experience Fragment (XF), an error popup appears and the XF does not paste.

The error log shows a message like:

com.day.cq.wcm.command.api.CommandException:
<source path> (Experience Fragment Template) not allowed below <target path>

This error usually indicates that the folder’s Allowed Templates do not contain the template that the XF uses. If the configuration is correct, the issue may result from behavior related to the XF master node. This article explains this behavior.

Environment
AEM as a Cloud Service
AEM 6.5

Resolution resolution

An XF normally has a master variation under the XF root, with the node name master.

This issue occurs when the XF has no master variation. For a new XF you cannot delete the master, but for a copied XF you can delete it. In most cases this problem happens because someone deleted the master of a copied XF.
Avoid deleting the master variation of an XF during normal operations.

During copy, AEM uses the master variation’s template to check the allowed templates of the target folder. If the XF has no master, this template check does not match the folder’s allowed templates. As a result, AEM shows an error and does not create the pasted XF.

To fix this issue, add a master variation under the XF:

  • Rename an existing variation node to master.
  • Or create a new variation with the name master.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f