I am trying to add an SXA module on a site node. Right-click site node > Scripts > Add site module. I am getting the below error in SPE logs.
19528 00:27:22 INFO Script item set to master:\system\Modules\PowerShell\Script Library\SXA\SXA - Scaffolding\Content Editor\Context Menu\Add Site Module in ScriptSession $scriptSession$|pei2g11lvrnhjedgzo3cee5x|8c329f12-7dfd-4d4e-9846-2220e4aa8130.
ManagedPoolThread #12 00:27:24 ERROR You cannot call a method on a null-valued expression.
I tried to debug the script - /sitecore/system/Modules/PowerShell/Script Library/SXA/SXA - Scaffolding/Content Editor/Context Menu/Add Site Module
By setting up the required context details as inputs.
Here, $SiteItem.Modules
is null because of which I suspect the actual error is coming.
Questions:
- From where this Modules information is coming or which item I could find this Modules information and why is it null?
Any fix for this?