Skip to content

MSM and Pages / Structure saving new pages data to wrong site #3634

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

Closed
robinsowell opened this issue Jul 25, 2023 · 0 comments · Fixed by #3640
Closed

MSM and Pages / Structure saving new pages data to wrong site #3634

robinsowell opened this issue Jul 25, 2023 · 0 comments · Fixed by #3640
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@robinsowell
Copy link
Contributor

robinsowell commented Jul 25, 2023

First report was issue with Pages module, but I tested and Structure is also affected

At first I thought this was a validation issue. I have a page_url on site 'a' 'my_test_url'. I then go to site b, make a new entry, put the same uri in. That should be allowed across sites, but it's coming back with a validation error that the uri is a duplicate.

On further investigation- NON duplicate uris don't appear to be saved.

On further further investigation, uris on site 'b' ARE saved, but they are saved under site 'a'. This would also explain the duplication warning- they really are duplicates because my site 'b' url is attempting to save in site 'a'.

Debugging it- in tabs.pages.php- if I am on site 'b' and I output the $site_id in the display function, it is correct:

    public function display($channel_id, $entry_id = '')
    {
		
		//var_dump(ee()->config->item('site_id'));

This is also why it appears site 'b' isn't saving the uri- it saved it to site 'a' it does not exist in site 'b' and so there is nothing to display.

If I dump the site id in function prepareSitePagesData it shows the wrong site- site 'a'.

Note- this test was done with all validation commented out. So I'm going to go undo that and test more. But user was getting the behavior on a totally clean copy.

STRUCTURE

So with Structure, if you're on site b, it's not saving the page uri to the wrong site, but it's not saving it at all, at least not in the pages array and it's not reflected in the entry display in the cp. It might LOOK like it saves it at first, because if it's not set, it apparently populates with the url title. But try editing the page uri to something else and... it doesn't stick. Also, if you look at the raw data, saving on site a does go into exp_sites and saving on site b does not:
Screenshot 2023-07-25 at 12 48 17 PM

@robinsowell robinsowell added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Jul 25, 2023
@robinsowell robinsowell changed the title MSM and Pages module saving new pages data to wrong site MSM and Pages / Structure saving new pages data to wrong site Jul 25, 2023
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
1 participant