Skip to content

Commit 618dfc9

Browse files
SITES-25061 - Category url format not working as expected in cloud instance (#1019)
* category URL fix - convert HTML encoded catergoryUid back into the actual characters * adding the required dependencies * AEM-uber jar version upgrade to 6.5.18 * fixing the test classes issue with increasing gson * docker image version upgrade for SP 18 * docker cloud-image version upgrade to recent * SP version upgrade to SP 18 which is now required * resolves the cloud bundle issues * fix for test case failure in AEM65 * adds categorycarousel component resource type to sling model to resolve the integration test issue --------- Co-authored-by: Alwin Joseph <aljoseph@adobe.com>
1 parent 50fd2de commit 618dfc9

File tree

8 files changed

+24
-9
lines changed

8 files changed

+24
-9
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ executors:
7272
docker:
7373
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
7474
<<: *docker_auth
75-
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:9398-openjdk11
75+
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:14227-openjdk11
7676
<<: *docker_auth
7777
test_executor_655:
7878
docker:
7979
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
8080
<<: *docker_auth
81-
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.8-openjdk11
81+
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.18.0-openjdk11
8282
<<: *docker_auth
8383

8484
jobs:

bundles/core/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<!-- Enable processing of OSGI metatype annotations -->
8888
<_metatypeannotations>*</_metatypeannotations>
8989
<Import-Package>
90+
com.adobe.cq.dam.cfm.content;version="[1.1.0,2)",
9091
javax.annotation;version=0.0.0,
9192
!org.apache.sling.sitemap.*,
9293
!com.adobe.aem.wcm.seo.*,
@@ -368,6 +369,10 @@
368369
<groupId>org.apache.commons</groupId>
369370
<artifactId>commons-collections4</artifactId>
370371
</dependency>
372+
<dependency>
373+
<groupId>org.apache.commons</groupId>
374+
<artifactId>commons-text</artifactId>
375+
</dependency>
371376
<dependency>
372377
<groupId>org.slf4j</groupId>
373378
<artifactId>slf4j-api</artifactId>
@@ -528,7 +533,7 @@
528533
<dependency>
529534
<groupId>com.google.code.gson</groupId>
530535
<artifactId>gson</artifactId>
531-
<version>2.8.5</version>
536+
<version>2.8.9</version>
532537
<scope>test</scope>
533538
</dependency>
534539
<dependency>

bundles/core/src/main/java/com/adobe/cq/commerce/core/components/internal/models/v1/categorylist/FeaturedCategoryListImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@
6464
@Model(
6565
adaptables = SlingHttpServletRequest.class,
6666
adapters = { FeaturedCategoryList.class, ComponentExporter.class },
67-
resourceType = com.adobe.cq.commerce.core.components.internal.models.v1.categorylist.FeaturedCategoryListImpl.RESOURCE_TYPE)
67+
resourceType = {
68+
com.adobe.cq.commerce.core.components.internal.models.v1.categorylist.FeaturedCategoryListImpl.RESOURCE_TYPE,
69+
"core/cif/components/commerce/categorycarousel/v1/categorycarousel"
70+
})
6871
@Exporter(
6972
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
7073
extensions = ExporterConstants.SLING_MODEL_EXTENSION)

bundles/core/src/main/java/com/adobe/cq/commerce/core/components/internal/services/CommerceLinksTransformerFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.IOException;
1919

2020
import org.apache.commons.lang3.StringUtils;
21+
import org.apache.commons.text.StringEscapeUtils;
2122
import org.apache.sling.api.SlingHttpServletRequest;
2223
import org.apache.sling.rewriter.DefaultTransformer;
2324
import org.apache.sling.rewriter.ProcessingComponentConfiguration;
@@ -143,7 +144,7 @@ public void startElement(String uri, String localName, String qName, Attributes
143144
linkInfo = new LinkInfo(urlProvider.toProductUrl(request, currentPage, productSku));
144145
}
145146
} else {
146-
String categoryUid = attributes.getValue(ATTR_CATEGORY_UID);
147+
String categoryUid = StringEscapeUtils.unescapeHtml4(attributes.getValue(ATTR_CATEGORY_UID));
147148
if (StringUtils.isNotBlank(categoryUid)) {
148149
Page currentPage = request.getResourceResolver().adaptTo(PageManager.class).getContainingPage(request.getResource());
149150
if (replaceText) {

examples/bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
<dependency>
378378
<groupId>com.google.code.gson</groupId>
379379
<artifactId>gson</artifactId>
380-
<version>2.8.5</version>
380+
<version>2.8.9</version>
381381
<scope>test</scope>
382382
</dependency>
383383
<dependency>

it/http/src/test/java/com/adobe/cq/commerce/it/http/ProductComponentIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void testProductPageWithSampleData65() throws Exception {
4747
doc -> doc.select("meta[name=keywords]").first().attr("content"), "Meta keywords for Chaz Kangeroo Hoodie",
4848
doc -> doc.select("meta[name=description]").first().attr("content"), "Meta description for Chaz Kangeroo Hoodie",
4949
// 6.5.8 uses the externalizer author link to create the canonical link
50-
doc -> doc.select("link[rel=canonical]").first().attr("href"), "http://localhost:4502" + pagePath));
50+
doc -> doc.select("link[rel=canonical]").first().attr("href"), pagePath));
5151
}
5252

5353
@Test

it/http/src/test/java/com/adobe/cq/commerce/it/http/ProductListComponentIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void testProductListPageWithSampleData65() throws Exception {
4949
doc -> doc.select("meta[name=keywords]").first().attr("content"), "Meta keywords for Outdoor Collection",
5050
doc -> doc.select("meta[name=description]").first().attr("content"), "Meta description for Outdoor Collection",
5151
// 6.5.8 uses the externalizer author link to create the canonical link
52-
doc -> doc.select("link[rel=canonical]").first().attr("href"), "http://localhost:4502" + pagePath));
52+
doc -> doc.select("link[rel=canonical]").first().attr("href"), pagePath));
5353
}
5454

5555
@Test

parent/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@
904904
<dependency>
905905
<groupId>com.adobe.aem</groupId>
906906
<artifactId>uber-jar</artifactId>
907-
<version>6.5.8</version>
907+
<version>6.5.18</version>
908908
<scope>provided</scope>
909909
</dependency>
910910

@@ -1007,6 +1007,12 @@
10071007
<version>${core.wcm.components.version}</version>
10081008
<scope>provided</scope>
10091009
</dependency>
1010+
<dependency>
1011+
<groupId>org.apache.commons</groupId>
1012+
<artifactId>commons-text</artifactId>
1013+
<version>1.10.0</version>
1014+
<scope>provided</scope>
1015+
</dependency>
10101016

10111017
<!-- Testing -->
10121018
<dependency>

0 commit comments

Comments
 (0)