LPS-36376 Only calculate portalSource once