(#23147) Add a spec test to reproduce the issue
(#23147) Make the catalog available to the resource during to_catalog

This reverts the logic in the fix for #22943 so that the catalog
is available to a resource during the to_ral conversion.
(#23147) Add alternate fix for #22943.

The original fix for 22943 induced this #23147; this patch
is an alternate fix for #22943 which allows checking the parent
even if it was previously found to be nil (which can happen
if the path is created during to_ral).
Merge pull request #2065 from kylog/issue/cannot-add-aliases-without-catalog

Issue/23147/cannot add aliases without catalog