Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when copying pages with page chooser #3

Open
jolamar opened this issue Sep 16, 2013 · 11 comments
Open

Issues when copying pages with page chooser #3

jolamar opened this issue Sep 16, 2013 · 11 comments

Comments

@jolamar
Copy link
Contributor

jolamar commented Sep 16, 2013

When copying pages that have a page chooser in the data definition, it won't copy if the page that's being included hasn't already been created. Here's the message I get:

<message>
page with path/name: path/to/page could not be found on site with id: null
</message>

Josh

@bradical
Copy link
Member

This is going to be a little tricky. We'd have to do a 2 pass approach where we first persist all of the assets and then go back and fill in asset chooser relationships.

@jolamar
Copy link
Contributor Author

jolamar commented Sep 19, 2013

Another possibility we thought about is to create the pages recursively as needed. For example, and to give you context, let's say we are building a hierarchy where pages include pages that include pages. So the script would look at all the pages in it, see if they exist and if not create them, and repeat the process for each of the pages all the way down until the pages all are created. I think this recursive approach would be the best to account for any level of page inclusion.

@bradical
Copy link
Member

Yep, that could work too.

We've explored both ways when implementing other types of features such as Site Migration and Site Import.

A couple of considerations for doing it this way:

  • You'd need to keep an inventory of what you had and hadn't created so you didn't end up trying to create the same asset twice
  • Plus you'd need to detect potential circularities.

If you do the 2-pass approach, you just need to keep track of any assignments and leave them blank during the 1st pass. Then go back and re-link the assets during the 2nd pass.

@jolamar
Copy link
Contributor Author

jolamar commented Sep 20, 2013

Good points! I played around with the recursive approach a bit and ran into the circularities issue where a child page included the parent page, so neither would ever create. I agree that the 2-pass approach is the way to go. I'll give this a shot, unless you're working on it already.

@bradical
Copy link
Member

I have not had a chance to look at that yet.

On Sep 20, 2013, at 11:03 AM, jolamar [email protected] wrote:

Good points! I played around with the recursive approach a bit and ran into the circularities issue where a child page included the parent page, so neither would ever create. I agree that the 2-pass approach is the way to go. I'll give this a shot, unless you're working on it already.


Reply to this email directly or view it on GitHub.

@jolamar
Copy link
Contributor Author

jolamar commented Sep 20, 2013

The 2-pass approach seems to work. I want to clean up the code a bit next week before submitting it.

@jolamar
Copy link
Contributor Author

jolamar commented Sep 26, 2013

I forked the project and submitted a pull request. This is my first time using GitHub so I hope I did everything correctly. I added comments for what I contributed.

@bradical
Copy link
Member

I saw your PR come through. I have a task on my list to review it shortly.

On Thu, Sep 26, 2013 at 3:35 PM, jolamar [email protected] wrote:

I forked the project and submitted a pull request. This is my first time
using GitHub so I hope I did everything correctly. I added comments for
what I contributed.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-25196693
.

@jolamar
Copy link
Contributor Author

jolamar commented Sep 26, 2013

Okay no rush. Just making sure I did it correctly. Thanks!

@bradical
Copy link
Member

Yep, you're all set. Did the script changes work well for you all?

On Thu, Sep 26, 2013 at 4:09 PM, jolamar [email protected] wrote:

Okay no rush. Just making sure I did it correctly. Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-25199493
.

@jolamar
Copy link
Contributor Author

jolamar commented Sep 26, 2013

Yeah! Without your 2-pass suggestion, we would have been stuck in a loop. I've also been adding some additional features that allow us to copy users/groups and transports/destinations/etc when copying a folder, but those don't appear in the PR. Since we are using custom authentication we have no don't need to copy a user's password over. However, we can't put in the password for FTP transports via Webservices as far as I can tell. This is pretty manageable for us if that's all managers need to modify after the migration. We are still going to be running some tests with migrating and we'll let you know how they turn out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants