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

Resolved #3124 where installing Structure did not properly populate records for existing Pages #3731

Open
wants to merge 1 commit into
base: 7.dev
Choose a base branch
from

Conversation

intoeetive
Copy link
Contributor

Resolved #3124 where installing Structure did not properly populate records for existing Pages

Before this change, the existing pages all were added as Listings. Which I think is not correct.

Now they are added as Pages.

One this that I noticed is that if you have Pages URI set as some/thing in Structure it will become just thing (the existing routes would work though until that is re-saved). I don't think we can reliably set parent ID here because in Pages you can have parts of URI names as anything, while in Structure both some and thing need to be URIs of existing entries. Also this seems to be pre-existing issue.

Since this is major change in data structure, we need to make sure to test in on site with very complex usage of Pages and see if nothing gets broken (thinking mostly existing routes, but also the CP)

@intoeetive intoeetive added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Aug 29, 2023
@intoeetive intoeetive added this to the 7.x milestone Aug 29, 2023
@intoeetive intoeetive modified the milestones: 7.x, 7.3.14 Oct 11, 2023
@robinsowell
Copy link
Contributor

Ah- interesting regarding structure that you can't save a / in the uri and they're (the segments) all independent entries. I tried saving an entry with this for the url - how-does-it-work/idk/dude and it didn't object but it saved it as how-does-it-work-idk-dude. I didn't realize that was the case- and I agree, we can't take a guess at creating parents.

I wonder if that would be a better way of adjusting/transforming the existing page uris that have slashes? While I didn't setup up my test to have something/cat/first and something/dog/first, what would happen if you did that? Would you have two structure uris with 'first' as the value? If you did the 'replace / with -' in existing page->structure transformation, it would eliminate that possibility and likely be more informative.

So- that's my one suggestion- instead of making an existing page uri with a / just the last segment, transform the / to a -, as structure would do saving it in the entry editor.

I also have a question about the Structure CP- on the validation page, I see no actionable issues, but I do have this:

Screenshot 2023-10-11 at 3 03 51 PM

It's a little confusing- it looks like the two columns should be reversed or I'm not understanding what it's showing me.

Otherwise- it's awesome seeing all of my existing pages in the Structure page in the cp and having the channels properly set to 'Page' type already.

And existing pages that had a / in them do still work, so nice.

The one other thing I find confusing- and this probably relates to that 'URL Mismatches' confusion I had above- I put a structure nav tag on my page, and the urls all used the old pages urls- so the ones with the / in them. I expected them to use the new urls- the ones that had been converted from pages format to structure format. So I expected how-does-it-work-idk-dude type instead of how-does-it-work/idk/dude.

It's confusing in part because if I go edit that entry, in the structure uri field before I save, I'd have, well right now I'd have 'dude'.

Meh- hope all of the above makes sense. But basically, I tend to think existing page uris with / should have those convert to - instead of truncating and I kind of expected a full conversion without saving the entry. In other words- I wouldn't really expect URL Mismatches and I think I'd expect my structure nav to reflect what a structure url would look like.

But- I also kind of get why it works that way. Tricky.

@intoeetive
Copy link
Contributor Author

@robinsowell I made a deeper dive and found that the fact only last segment is shown in the URI input actually has nothing to do with installer. It takes the record directly from site_pages field, splits it with / and takes the last part. So if we would want to replace / with - we'd have to modify site_pages, which will also make current URLs that have slash in thm to not work anymore. So I would rather not do that.

@bryannielsen bryannielsen modified the milestones: 7.3.14, 7.x Oct 23, 2023
@intoeetive intoeetive modified the milestones: 7.x, 7.4.0 Nov 9, 2023
@intoeetive intoeetive modified the milestones: 7.4.0, 7.x Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants