I've run into a problem where my post-login profile pageroutes end up redirecting to one one of the pages that's shared across the different memtypes I've set up. I've tracked the bug pretty thoroughly, and it comes down to the way that the $incomplete_requirements variable gets filled. The $user_pages array always gets filled in the proper order with respect to the weights assigned in the pageroute GUI and stored in the pageroute table, but because the foreach loop pulls from $required_types, it's actually possible that $incomplete_requirements can be filled with the right pageroute values, but in the wrong order.

I didn't want to tamper with the use of $required_types in the foreach loop because there may be a reason for using that that I'm not aware of, so I implemented an after-the-fact solution instead. Unfortunately, there's no way for it $incomplete_requirements to know that the values it has are wrong, so the sort() that's in there right now in one of the functions doesn't actually help. I've substituted a sort-by-intersect approach that uses the values from $user_pages, which we know are in the appropriate order, to generate an $incomplete_requirements array that has all the right elements in all the right places.

CommentFileSizeAuthor
nf_registration_mod_sorting.patch1.34 KBsdboyer

Comments

rconstantine’s picture

Thanks for this patch, but I have already fixed this in my copy and will include it in the next release. I won't close this issue, though, until I make the post. Should be soon. The problem originally wasn't visible to me because I named my profile content types like reg_page_1, reg_page_2, etc. so they were always in the right order as the list was alphabetical by content type machine name as you found out.

I'll have to look at your code anyway and see how you did it. Maybe you did it cleaner.

sdboyer’s picture

Sounds good. Thanks!

rconstantine’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.