Skip to content

Commit 6ea9ba2

Browse files
author
Victor POLLET
committed
Added correction that taxonomy picker crashed when SharePoint return default empty Guid on anchorId
1 parent 6871613 commit 6ea9ba2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/common/Constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ export const InvariantCulture: ICultureInfo = {
108108
MonthGenitiveNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ''],
109109
eras: [1, 'A.D.', null, 0]
110110
}
111-
};
111+
};
112+
113+
export const EmptyGuid: string = "00000000-0000-0000-0000-000000000000";

src/controls/taxonomyPicker/TermPicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as strings from 'ControlStrings';
99
import { Icon } from 'office-ui-fabric-react/lib/Icon';
1010
import { ExtensionContext } from '@microsoft/sp-extension-base';
1111
import { ITermSet } from "../../services/ISPTermStorePickerService";
12+
import { EmptyGuid } from '../../Common';
1213

1314
export class TermBasePicker extends BasePicker<IPickerTerm, IBasePickerProps<IPickerTerm>>
1415
{
@@ -118,7 +119,7 @@ export default class TermPicker extends React.Component<ITermPickerProps, ITermP
118119
} = this.props;
119120

120121
let terms: IPickerTerm[] = [];
121-
if (termPickerHostProps.anchorId) {
122+
if (termPickerHostProps.anchorId && termPickerHostProps.anchorId !== EmptyGuid) {
122123
terms = await this.termsService.searchTermsByTermId(filterText, termPickerHostProps.anchorId,);
123124
}
124125
else {

0 commit comments

Comments
 (0)