New deployment is removing all styling

Description

Environment
Experience Manager

Issue/Symptoms
After deploying a pipeline on one environment, the customer noticed that the custom styles from a template, and as a consequence, the styles from the page created with that template were removed.

Figure 1. The template with the styles present.

Figure 2. The template without the styles.

Resolution

When the project that the customer had deployed in their environment was reviewed, it was discovered that the filter.xml file under the branch that was in charge of changing the content—in this example, 1 —contained the filters 2.
The template that was modified after the deployment was located at /conf/path/settings/wcm/templates/modified template, but it had no filter mode, which by default indicates replace.
This implies that anytime a pipeline is deployed, the path in the code will be used instead.
This has to be fixed by setting the filter mode to merge like it is for the other paths 3.

1

/aem-cust-project.all-0.0.1-SNAPSHOT/jcr_root/apps/cust-packages/content/install/aem-cust-project.ui.content-0.0.1-SNAPSHOT/META-INF/vault/filter.xml

2

workspaceFilter version="1.0"filter root="/conf/path/settings/wcm/templates/modified_template"/filter root="/conf/path" mode="merge"/filter root="/conf/path2" mode="merge"/filter root="/content/path2" mode="merge"/filter root="/content/dam/path2/asset.jpg" mode="merge"/filter root="/content/experience-fragments/path2" mode="merge"//workspaceFilter

3

workspaceFilter version="1.0"filter root="/conf/path/settings/wcm/templates/modified_template" mode="merge"/filter root="/conf/path" mode="merge"/filter root="/conf/path2" mode="merge"/filter root="/content/path2" mode="merge"/filter root="/content/dam/path2/asset.jpg" mode="merge"/filter root="/content/experience-fragments/path2" mode="merge"//workspaceFilter

On this page