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

The Model Parent value is not displayed in the "Update Model Parent" schema settings #1935

Closed
b-estevez opened this issue Mar 17, 2023 · 15 comments · Fixed by #1947
Closed
Assignees
Labels
bug Something isn't working

Comments

@b-estevez
Copy link

Instance Zuid: 8-ac91ad86e9-txcblw

As we can see in the image below, all headless models are all under of "Homepage" single page model:
image

also looking from the api, those headless models have a parentZUID value: "7-c8fbcdd3a1-wrn5jp"which is the item zuid of the Homepage
image


image


image

But in the schema settings under Info, those headless models have no parent model (sample image below):

image

image

Because of this, the user cannot update the parent model of a specific model.

Please feel free to reach out for more details in regards to this.

@agalin920
Copy link
Contributor

agalin920 commented Mar 20, 2023

@b-estevez How did this happen? This is an erroneous state. A model should not have a 7- parentZuid.

@b-estevez
Copy link
Author

@agalin920 , those 3 headless models hero_section, main_content,side_content was already have a parent model which is "Homepage" before the new schema interface was released. Meaning I assigned the parent model with the old schema interface.

I was trying to remove the current parent model of each headless model but the current value of the parent model is "None". I also tried to save it with "none" as a parent model value but those 3 headless models are still under "Homepage" content item.
image

@agalin920
Copy link
Contributor

agalin920 commented Mar 20, 2023

@b-estevez try setting another model as a parent to get it out of that bad state and then select none.

Its would also be great if you cam provide more information on how this instance got into that state and how to reproduce it

@agalin920
Copy link
Contributor

We can take this ticket to better handle what we show there for invalid model zuids

@b-estevez
Copy link
Author

@b-estevez try setting another model as a parent to get it out of that bad state and then select none.

Its would also be great if you cam provide more information on how this instance got into that state and how to reproduce it

@agalin920 I also tried changing the parent model field to another single page model but it doesn't work. You can see how I did it from loom video link below:
https://www.loom.com/share/e13734e08b6a47e1a1f9715a468ec545

I don't know if the mechanics in changing a parent model value between new and old schema UI are different, but that is the only difference that I can capture.

@agalin920
Copy link
Contributor

agalin920 commented Mar 22, 2023

Right but i believe that is the expectation because there is a specific headless model section where they appear. Also this case is not a case schema will cause so you cannot select a 7- as a parent

@giseleblair
Copy link
Contributor

@agalin920 according to the API we should be allowed to select a 7- item (so long as that's a single page model) https://www.loom.com/share/bbd3d2241b0c417baccaa5a96cd65032

@agalin920
Copy link
Contributor

agalin920 commented Mar 22, 2023

@giseleblair So then in the model parent dropdown select we also need to list all the single page model items? Im guessing env/nav endpoint can be leveraged to reduce api call count

@giseleblair
Copy link
Contributor

@agalin920 yes, that sounds like a good approach

@agalin920
Copy link
Contributor

@theofficialnar I know discussed this the other day. Let's move forward with it

@finnar-bin
Copy link
Contributor

finnar-bin commented Mar 22, 2023

@agalin920 gotcha, I'll change the dropdown options of the parent zuid to the values from /env/nav.

@finnar-bin finnar-bin self-assigned this Mar 22, 2023
@finnar-bin finnar-bin added the bug Something isn't working label Mar 24, 2023
@finnar-bin
Copy link
Contributor

finnar-bin commented Mar 27, 2023

Hey @giseleblair, just wanted to confirm something as I have stumbled on this while testing out the fix. I noticed that updating the parent model of an already existing single page model doesn't change where it is nested in the content nav tree, it just stays on where it was originally on the content nav, it doesn't matter what the selected parent model's type is. I had to manually change that single page item's path under seo & meta for it to be nested correctly on the content nav. It's also worth noting that I'm already using the correct parentZUIDs from /env/nav - since this is the fix for the original issue raised by @b-estevez. For headless and multi-page models there are no issues.

I tried on both new and old schema and it behaves the same way for single page models, changing the model parent doesn't change where that single page model is on the content nav tree.

Recording.2023-03-27.141123.mp4

@giseleblair
Copy link
Contributor

@theofficialnar
Changing a parent model of existing item(s) does not retroactively change the parent of that item. Setting a parent model will only take effect when new a new item is created after the parent has been declared. This may be a warning we should setup when changing the parent of a model with existing items. Can you also test this workflow with data set model types: multi-page and headless. What does the navigation behavior look like for both of these models?

@giseleblair
Copy link
Contributor

@theofficialnar please also test with multi-lang enabled

@finnar-bin
Copy link
Contributor

finnar-bin commented Mar 28, 2023

@theofficialnar Changing a parent model of existing item(s) does not retroactively change the parent of that item. Setting a parent model will only take effect when new a new item is created after the parent has been declared. This may be a warning we should setup when changing the parent of a model with existing items. Can you also test this workflow with data set model types: multi-page and headless. What does the navigation behavior look like for both of these models?

@giseleblair Here's what happens to the item's location in the content nav tree on both old and new schema after the model's parent has been changed.

Old Schema:
Single page - not moved in content app nav tree when creating a new item after model parent was changed
Multi - moved immediately after model parent was changed
Headless - moved immediately after model parent was changed

New Schema
Single page - not moved in content app nav tree when creating a new item after model parent was changed
Multi - moved immediately after model parent was changed
Headless - moved immediately after model parent was changed

So it seems like Single Page items really just stay where they are on the content app's nav tree even after changing its model's parent schema since it behaves the same way on both old and new schema. I'm not exactly sure if that's the expected behavior but after checking old schema it's behaving exactly the same way for Single Page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants