Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

PicklistAnalyzer errors out if other other non CustomField Metadata is processed first #1367

Closed
cjbradshaw opened this issue Jul 24, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@cjbradshaw
Copy link
Contributor

Describe the bug
The PicklistAnalyzer runs to determine if picklist components should be processed.
If it finds a CustomField of type picklist it marks isPickListsFound as true meaning picklists are processed as part of the run
If you have non CustomField Metadata that appears first in the array of component metadata then the .CustomField accessor fails forcing the processing to error. This means isPickListsFound remains false and picklists are not processed

To Reproduce
Steps to reproduce the behavior:
create a package and include a new custom object :
AD_Test_Plan__c
Include a lookup field to Account called Acccount__c and include a new custom layout with the same api name as the custom object : AD_Test_Plan.compactLayout-meta.xml
image

Run a quickbuild :
sfp orchestrator:quickbuild -v devhub --diffcheck --buildnumber 1 --branch master --loglevel=trace
Run a deploy :
sfp orchestrator:deploy -u dev --loglevel=trace

Expected behavior
The picklist Enabler will error :
"Unable to process Picklist update due to Cannot read properties of undefined (reading 'type')
Pre Deployer Picklist Enabler skipped or not enabled"

image

Looking at the code, the PicklistAnalyzer when it builds the array of components - the .getChildren() can include different types of metadata. Probably simple to fix with a check for customField when it iterates the components

Screenshots
See above

Platform Details (please complete the following information):

  • OS: MacOS
  • Version [e.g. CLI Version eg: 1.6.6] : @dxatscale/sfpowerscripts/22.6.1
  • Salesforce CLI(sfdx cli) Version: 7.194.1
  • CI Platform: Github Actions

Additional context
I've debugged this locally and found a simple fix

@github-actions github-actions bot added the analysis To be decided on how to solution/fix label Jul 24, 2023
@azlam-abdulsalam azlam-abdulsalam added bug Something isn't working and removed analysis To be decided on how to solution/fix labels Jul 25, 2023
@azlam-abdulsalam azlam-abdulsalam added this to the July 23 milestone Jul 25, 2023
@azlam-abdulsalam
Copy link
Contributor

Thanks @cjbradshaw , This has been added to the release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants