From 1a1134b8e2b9fe94b0380b5a91f9952242ce56a5 Mon Sep 17 00:00:00 2001
From: James Simone <16430727+jamessimone@users.noreply.github.com>
Date: Thu, 2 Jan 2025 12:14:34 -0700
Subject: [PATCH] v1.7.3 - Fix Namespace Shadowing Issue (#644)
* Fixes #643 by properly referencing Schema namespace in RollupFieldInitializer
---
.github/workflows/deploy.yml | 2 +-
README.md | 4 ++--
package.json | 2 +-
rollup-namespaced/sfdx-project.json | 4 ++--
rollup/core/classes/RollupFieldInitializer.cls | 14 +++++++-------
rollup/core/classes/RollupLogger.cls | 2 +-
sfdx-project.json | 7 ++++---
7 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 8e520d74..805d56c2 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -32,7 +32,7 @@ on:
jobs:
scratch-org-test:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
environment: Test
steps:
# Checkout the code
diff --git a/README.md b/README.md
index 73802671..9c2a6a5c 100644
--- a/README.md
+++ b/README.md
@@ -24,11 +24,11 @@ As well, don't miss [the Wiki](../../wiki), which includes even more info for co
## Deployment & Setup
-
+
-
+
diff --git a/package.json b/package.json
index 41b5e9e1..8f0afd22 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "apex-rollup",
- "version": "1.7.2",
+ "version": "1.7.3",
"description": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"repository": {
"type": "git",
diff --git a/rollup-namespaced/sfdx-project.json b/rollup-namespaced/sfdx-project.json
index bb1f4a87..77b4037c 100644
--- a/rollup-namespaced/sfdx-project.json
+++ b/rollup-namespaced/sfdx-project.json
@@ -4,8 +4,8 @@
"default": true,
"package": "apex-rollup-namespaced",
"path": "rollup-namespaced/source/rollup",
- "versionName": "Fixes issue in RollupCalcItemReplacer where custom Type fields were incorrectly flagged as polymorphic",
- "versionNumber": "1.2.2.0",
+ "versionName": "Fixes namespace shadowing issue in RollupFieldInitializer",
+ "versionNumber": "1.2.3.0",
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
"unpackagedMetadata": {
diff --git a/rollup/core/classes/RollupFieldInitializer.cls b/rollup/core/classes/RollupFieldInitializer.cls
index 56436c24..2ff635e4 100644
--- a/rollup/core/classes/RollupFieldInitializer.cls
+++ b/rollup/core/classes/RollupFieldInitializer.cls
@@ -15,7 +15,7 @@ public virtual class RollupFieldInitializer {
return Datetime.newInstanceGmt(dt.yearGmt(), dt.monthGmt(), dt.dayGmt(), dt.hourGmt(), dt.minuteGmt(), dt.secondGmt());
}
- public virtual Object getDefaultValue(SObjectField field) {
+ public virtual Object getDefaultValue(Schema.SObjectField field) {
DescribeFieldResult fieldDescribe = field.getDescribe();
if (fieldDescribe.isDefaultedOnCreate() && fieldDescribe.getDefaultValue() != null) {
return fieldDescribe.getDefaultValue();
@@ -55,7 +55,7 @@ public virtual class RollupFieldInitializer {
return initializedDefault;
}
- public SObjectField getSObjectFieldByName(Map fieldNameToField, String desiredField) {
+ public SObjectField getSObjectFieldByName(Map fieldNameToField, String desiredField) {
if (fieldNameToField.containsKey(desiredField)) {
return fieldNameToField.get(desiredField);
} else if (fieldNameToField.containsKey(desiredField + 'Id')) {
@@ -83,9 +83,9 @@ public virtual class RollupFieldInitializer {
private List activeVals;
private Map picklistToRank;
- public PicklistController(DescribeFieldResult fieldDescribe) {
+ public PicklistController(Schema.DescribeFieldResult fieldDescribe) {
super();
- DisplayType fieldType = fieldDescribe?.getType();
+ Schema.DisplayType fieldType = fieldDescribe?.getType();
this.isPicklist = fieldType == DisplayType.MULTIPICKLIST || fieldType == DisplayType.PICKLIST;
this.isMultiSelectPicklist = fieldType == DisplayType.MULTIPICKLIST;
@@ -102,7 +102,7 @@ public virtual class RollupFieldInitializer {
List picklistVals = fieldDescribe.getPicklistValues();
for (Integer index = 0; index < picklistVals.size(); index++) {
- PicklistEntry picklist = picklistVals[index];
+ Schema.PicklistEntry picklist = picklistVals[index];
this.doBookkeepingOnPicklist(picklist);
// all inactive values will use -1 as a sentinel value
picklistToRank.put(picklist.getValue(), picklist.isActive() ? index : -1);
@@ -110,7 +110,7 @@ public virtual class RollupFieldInitializer {
}
}
- private void doBookkeepingOnPicklist(PicklistEntry picklist) {
+ private void doBookkeepingOnPicklist(Schema.PicklistEntry picklist) {
if (picklist.isDefaultValue() && this.activeVals.isEmpty()) {
this.activeVals.add(picklist.getValue());
} else if (picklist.isActive()) {
@@ -118,7 +118,7 @@ public virtual class RollupFieldInitializer {
}
}
- public override Object getDefaultValue(SObjectField field) {
+ public override Object getDefaultValue(Schema.SObjectField field) {
return this.isPicklist == false ? super.getDefaultValue(field) : this.activeVals[0];
}
diff --git a/rollup/core/classes/RollupLogger.cls b/rollup/core/classes/RollupLogger.cls
index 06d3bc8d..1012b0d2 100644
--- a/rollup/core/classes/RollupLogger.cls
+++ b/rollup/core/classes/RollupLogger.cls
@@ -1,7 +1,7 @@
global without sharing virtual class RollupLogger implements ILogger {
@TestVisible
// this gets updated via the pipeline as the version number gets incremented
- private static final String CURRENT_VERSION_NUMBER = 'v1.7.2';
+ private static final String CURRENT_VERSION_NUMBER = 'v1.7.3';
private static final System.LoggingLevel FALLBACK_LOGGING_LEVEL = System.LoggingLevel.DEBUG;
private static final RollupPlugin PLUGIN = new RollupPlugin();
diff --git a/sfdx-project.json b/sfdx-project.json
index 27f34b1d..630409ad 100644
--- a/sfdx-project.json
+++ b/sfdx-project.json
@@ -5,8 +5,8 @@
"package": "apex-rollup",
"path": "rollup",
"scopeProfiles": true,
- "versionName": "Fixes issue in RollupCalcItemReplacer where custom Type fields were incorrectly flagged as polymorphic",
- "versionNumber": "1.7.2.0",
+ "versionName": "Fixes namespace shadowing issue in RollupFieldInitializer",
+ "versionNumber": "1.7.3.0",
"versionDescription": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"releaseNotesUrl": "https://github.com/jamessimone/apex-rollup/releases/latest",
"unpackagedMetadata": {
@@ -108,6 +108,7 @@
"apex-rollup@1.6.37": "04t6g000008OfSEAA0",
"apex-rollup@1.7.0": "04t6g000008OfTvAAK",
"apex-rollup@1.7.1": "04t6g000008OfWQAA0",
- "apex-rollup@1.7.2": "04t6g000008OfXTAA0"
+ "apex-rollup@1.7.2": "04t6g000008OfXTAA0",
+ "apex-rollup@1.7.3": "04t6g000008OfdwAAC"
}
}