Skip to content

Commit

Permalink
Release 22.12 to master (#23490)
Browse files Browse the repository at this point in the history
* Fixing artifact plgin invocation. Need to use Gralde version 6.9.3 in order for this to work.

* #22864 Categories - $contentlet.categories can be slow

* #22864 adding cache for pullAllCategoryChildren

* #22864 adding cache for pullAllCategoryChildren

* #22864 adding cache for pullAllCategoryChildren

* #22864 adding cache for pullAllCategoryChildren

* #22864 much faster

* Fixing Postman Test: `VanityURL.postman_collection.json`

* Removing infinite loop call.

Co-authored-by: Jose Castro <jose.castro@dotcms.com>

* Trigger builds

* CI: bumps version to 22.11.0-rc.5 [skip ci]

* CI: bumps version to 22.11.0-rc.16 [skip ci]

* #23056 : REVERT - Reverting changes in `docker-compose` files. (#23425)

Reverting changes in `docker-compose` files to avoid overwriting important changes already present in `master` branch. Additionally, adding a fix provided by Todd which would add the appropriate `LANG` environment variable when applying the config defaults.

* #23296 Bug: WYSIWYG NPE if it finds an invalid data-elements

* #23401 Insure zip file integrity

* #22857 Keep the contentlets references up to date in the block editor

* #22867 cherry pick done

* fixing unit test, a value missing in a msg format

* CI: bumps version to 22.11.0-rc.6 [skip ci]

* Increase version

* CI: bumps version to 22.12.0-rc.2 [skip ci]

* CI: bumps version to 22.12.0-rc.2 [skip ci]

* Increase version rc (#23486)

* Increase version rc

* Increase version rc

* CI: bumps version to 22.12.0-rc.4 [skip ci]

* CI: bumps version to 22.13.0-next.3 [skip ci]

* CI: bumps version to 23.1.0-next.2 [skip ci]

* Fixing merge conflicts in docker-compose files.

* Bringing LANG variable back.

* CI: bumps version to 23.1.0-next.3 [skip ci]

Co-authored-by: Victor Alfaro <victor.alfaro@dotcms.com>
Co-authored-by: Will Ezell <will@dotcms.com>
Co-authored-by: Jose Castro <jose.castro@dotcms.com>
Co-authored-by: Jonathan <jonathan.sanchez@dotcms.com>
  • Loading branch information
5 people committed Dec 5, 2022
1 parent e05d9f6 commit 8b92a38
Show file tree
Hide file tree
Showing 27 changed files with 7,058 additions and 22,804 deletions.
2 changes: 1 addition & 1 deletion core-web/libs/dotcms-webcomponents/package.json
@@ -1,6 +1,6 @@
{
"name": "dotcms-webcomponents",
"version": "23.1.0-next.2",
"version": "23.1.0-next.3",
"main": "./dist/index.cjs.js",
"module": "./dist/index.js",
"es2015": "./dist/esm/index.mjs",
Expand Down
29,078 changes: 6,644 additions & 22,434 deletions core-web/package-lock.json

Large diffs are not rendered by default.

Expand Up @@ -38,7 +38,6 @@ services:
dotcms:
image: dotcms/dotcms:latest
environment:
"LANG": 'C.UTF-8'
"DB_BASE_URL": "jdbc:postgresql://db/dotcms"
"DB_USERNAME": 'dotcmsdbuser'
"DB_PASSWORD": 'password'
Expand Down
Expand Up @@ -35,7 +35,6 @@ services:
dotcms-dev:
image: dotcms/dotcms:latest
environment:
"LANG": 'C.UTF-8'
"CATALINA_OPTS": " -Xms1g -Xmx1g "
"DB_BASE_URL": "jdbc:sqlserver://db-dev;databaseName=master"
"DB_USERNAME": "sa"
Expand Down
2 changes: 2 additions & 0 deletions docker/dotcms/ROOT/srv/00-config-defaults.sh
Expand Up @@ -8,6 +8,8 @@

set -e

export LANG=${LANG:-"C.UTF-8"}

## Tomcat config

export TOMCAT_HOME=/srv/dotserver/tomcat
Expand Down
6 changes: 3 additions & 3 deletions dotCMS/src/curl-test/VanityURL.postman_collection.json
@@ -1,9 +1,9 @@
{
"info": {
"_postman_id": "3875c184-d685-419e-9898-2d955324fa1a",
"_postman_id": "d0681ce1-9d22-4d9e-a138-11c51bea2b71",
"name": "VanityURL",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "4500400"
"_exporter_id": "5403727"
},
"item": [
{
Expand Down Expand Up @@ -222,7 +222,7 @@
" pm.response.to.have.status(404);",
" var body = pm.response.body;",
"",
" pm.expect(pm.response.text(), \"Got wrong page\").to.include(\"Page Not Found\");",
" pm.expect(pm.response.text(), \"Got wrong page\").to.include(\"Not Found\");",
"});"
],
"type": "text/javascript"
Expand Down
@@ -1,3 +1,4 @@

package com.dotcms.contenttype.business;

import com.dotcms.IntegrationTestBase;
Expand All @@ -11,6 +12,7 @@
import com.dotmarketing.portlets.contentlet.model.Contentlet;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.liferay.util.StringPool;
import io.vavr.Tuple2;
import io.vavr.control.Try;
import org.junit.Assert;
import org.junit.BeforeClass;
Expand All @@ -29,7 +31,7 @@ public class StoryBlockAPITest extends IntegrationTestBase {

private static final String JSON =

"{\n" +
"{\n" +
" \"type\":\"doc\",\n" +
" \"content\":[\n" +
" {\n" +
Expand Down Expand Up @@ -114,7 +116,7 @@ public void test_refresh_references() throws DotDataException, DotSecurityExcept
Assert.assertNotNull(newStoryBlockMap);
final List contentList = (List) newStoryBlockMap.get("content");
final Optional<Object> firstContentletMap = contentList.stream()
.filter(content -> "dotContent".equals(Map.class.cast(content).get("type"))).findFirst();
.filter(content -> "dotContent".equals(Map.class.cast(content).get("type"))).findFirst();

Assert.assertTrue(firstContentletMap.isPresent());
final Map contentletMap = (Map) Map.class.cast(Map.class.cast(firstContentletMap.get()).get(StoryBlockAPI.ATTRS_KEY)).get(StoryBlockAPI.DATA_KEY);
Expand Down Expand Up @@ -174,6 +176,7 @@ public void test_get_dependencies() throws DotDataException, DotSecurityExceptio
.readValue(Try.of(() -> newStoryBlockJson3.toString())
.getOrElse(StringPool.BLANK), LinkedHashMap.class);


Assert.assertNotNull(newStoryBlockMap);
final List<String> contentletIdList = APILocator.getStoryBlockAPI().getDependencies(newStoryBlockJson3);
Assert.assertNotNull(contentletIdList);
Expand All @@ -182,5 +185,4 @@ public void test_get_dependencies() throws DotDataException, DotSecurityExceptio
Assert.assertTrue(contentletIdList.contains(richTextContentlet2.getIdentifier()));
Assert.assertTrue(contentletIdList.contains(richTextContentlet3.getIdentifier()));
}

}
}
Expand Up @@ -6,6 +6,7 @@
import com.dotcms.content.elasticsearch.ESQueryCache;
import com.dotcms.content.elasticsearch.util.RestHighLevelClientProvider;
import com.dotcms.contenttype.business.StoryBlockReferenceResult;
import com.dotcms.contenttype.model.field.DataTypes;
import com.dotcms.contenttype.model.type.BaseContentType;
import com.dotcms.enterprise.license.LicenseManager;
import com.dotcms.exception.ExceptionUtil;
Expand Down Expand Up @@ -73,6 +74,7 @@
import com.google.common.collect.Lists;
import com.google.common.primitives.Ints;
import com.liferay.portal.model.User;
import io.vavr.Tuple2;
import io.vavr.control.Try;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -890,6 +892,7 @@ private Contentlet processCachedContentlet(final Contentlet cachedContentlet) {
if (storyBlockRefreshedResult.isRefreshed()) {
Logger.debug(this, () -> String.format("Refreshed Story Block dependencies for Contentlet '%s'",
cachedContentlet.getIdentifier()));

final Contentlet refreshedContentlet = (Contentlet) storyBlockRefreshedResult.getValue();
contentletCache.add(refreshedContentlet.getInode(), refreshedContentlet);
return refreshedContentlet;
Expand Down
Expand Up @@ -1502,24 +1502,23 @@ public Object getFieldValue(final Contentlet contentlet,
return contentlet.getFolder();
}
} else if (theField instanceof CategoryField) {
final Category category = this.categoryAPI.find(theField.values(), currentUser, respectFrontEndRoles);
final Category categoryField = this.categoryAPI.find(theField.values(), currentUser, respectFrontEndRoles);
// Get all the Contentlets Categories
final List<Category> selectedCategories = this.categoryAPI
.getParents(contentlet, currentUser, respectFrontEndRoles);
final Set<Category> categoryList = new HashSet<>();
final List<Category> categoryTree = this.categoryAPI
.getAllChildren(category, currentUser, respectFrontEndRoles);
if (selectedCategories.size() > 0 && categoryTree != null) {
for (int k = 0; k < categoryTree.size(); k++) {
final Category cat = categoryTree.get(k);
for (final Category categ : selectedCategories) {
if (categ.getInode().equalsIgnoreCase(cat.getInode())) {
categoryList.add(cat);
}
}
}
if(selectedCategories.isEmpty()) {
return List.of();
}
return categoryList;
final List<Category> availableCategories = this.categoryAPI
.getAllChildren(categoryField, APILocator.systemUser(), false);
if(availableCategories.isEmpty()) {
return List.of();
}
selectedCategories.retainAll(availableCategories);

return selectedCategories;



} else if (theField instanceof RelationshipField) {
final ContentletRelationships contentletRelationships = new ContentletRelationships(
Expand Down
Expand Up @@ -40,7 +40,9 @@ public interface StoryBlockAPI {
* @param contentlet The Contentlet containing the Story Block field(s).
*
* @return The {@link StoryBlockReferenceResult} object containing the final result of the refreshing process.
* Encapsulates the allowed types for contentlets on the story block
*/

StoryBlockReferenceResult refreshReferences(final Contentlet contentlet);

/**
Expand Down

0 comments on commit 8b92a38

Please sign in to comment.