Programatically updating a page path (cHandle) requires rescanCollectionPath()6 users found helpful
I didn't see any mention of rescanCollectionPath() here in the forums. So I hope this post helps someone in the future.
Here is an example:
$pagebycID = Page::getByID('113'); $new_data = array(); $new_data['cHandle'] = 'new-path'; $new_data['cName'] = 'new-title'; $pagebycID->update($new_data); $pagebycID->rescanCollectionPath();
Also thanks to jshannon and digia3 on IRC for their help.
Took me a minute to figure this out too..
I wasted more than a day trying to fix this problem.