fix(CLI Tool): #3589077 Fall back to remote path when local spec has no path field
When a page spec has no path field, preparePages() defaults it to an empty string via spec.path ?? ''. pushPages() then calls updatePage() with path: '', which clears the Drupal URL alias for the page. This affects specs written before path was added to the format, manually authored specs without a path key, and specs pulled against an older Canvas module version that did not return path in the API response.
The fix falls back to remotePage.path when the local spec path is empty.
Testing instructions
- Pull a Canvas page, remove the
pathfield from the local spec file, then runcanvas push— verify the URL alias on the remote page is unchanged. - Pull a Canvas page, keep the
pathfield intact, runcanvas push— verify the URL alias is preserved as expected.
AI Disclosure: Used Claude (Anthropic) to identify root cause, write regression unit test, write integration test suite for page API operations, and generate the one-line fix.
Closes #3589077
Edited by Matt Glaman