This project is read-only.

Shape alternates in 1.6

Topics: Troubleshooting
Jan 30, 2013 at 4:43 PM

I've updated my web site from 1.5.1 to 1.6. On the home page, I was using an alternate to display news. The name was built like this:


It was working fine in 1.5.1 and shape tracing was showing this alternate (I still see it on prod server). On 1.6, this alternate doesn't work anymore and is not shown as an option by shape tracing tool. Did you remove such alternate in 1.6 or is there something I should change?

Jan 31, 2013 at 2:33 AM
Edited Jan 31, 2013 at 2:33 AM
It does work just fine in 1.6. You probably disabled the content alternates feature by mistake at some point.
Jan 31, 2013 at 1:17 PM
Edited Jan 31, 2013 at 1:17 PM
Thanks for the feedback.

I don't think so. I did an in place upgrade as it's a dev site and compared all modules with the prod site (still on 1.5.1) that is working. Everything is the same. No module has been disabled. But maybe I forgot a step during in place upgrade. Note that everything else works fine, including other content alternates such as "Parts.Common.Body-MyEvent-url-homepage.cshtml".

But on my home page, I have a widget that displays a projection. I was using an alternate for that content. It's only in that situation that the alternate doesn't work (and seems not to be supported as shape tracing doesn't show that option either). I will try with a clean install to see if I can reproduce the problem or if it only appear with that upgrade.
Feb 1, 2013 at 12:39 PM
I did the same test on a new installation of Ochard 1.5. I created a query and added it to the home as a projection widget using a grid layout. After installing Designer Tools 1.6, I checked the available alternates and noticed that I have the same problem as I have after the upgrade. So I tried again with Orchard 1.5.1, but this time installed Designer Tools 1.4.2. And now it works. The alternate Content-Page-url-homepage.cshtml appears in shape tracing list. If I then upgrade Designer Tools to 1.6, that alternate disappears. So the problem doesn't come from the Orchard 1.5.1 to 1.6 upgrade, but from the upgrade of Designer Tools from 1.4.2 to 1.6. Could you tell me if it's a bug in Designer Tools 1.6 or if it has been decided to remove that alternate?
Feb 1, 2013 at 2:37 PM
As a complement, here are screenshorts of shape tracing utility. The same shape is selected. The first one using version 1.4.2 of Designer Tools, the second one using version 1.6.


Feb 6, 2013 at 1:26 PM
Nobody can confirm if the change between versions of Designer Tools is by design or a bug?
Feb 6, 2013 at 6:06 PM
This looks like a regression, that url alternates are not generated for every current alternate.
Feb 6, 2013 at 9:33 PM
I found what causes this regression. So if it's not a desired behavior, it can be fixed by changing UrlAlternatesFActory.cs in designer tools module services subfolder. In Displaying function, alternates are applied to context. Previously, they were applied to displayedContext. So to recover all url alternates, the following command should be restored:

context.ShapeMetadata.OnDisplaying(displayedContext => { ... });

And all references to context should be replaced by displayedContext.
Feb 7, 2013 at 7:53 AM
I take the opportunity of this thread to ask again about this difference in the text comment and the corresponding implemebtation in shapes.cs
Where is the truth ? bug ?
Thanks for feedback.
Mar 26, 2013 at 10:04 AM
Could someone confirm if it's a bug in new version or a desired behavior. It's important to know so that I try to find other solutions for web sites using the alternates that are not available in 1.6 any more. Thanks in advance.
Mar 27, 2013 at 8:26 AM
Didn't Sébastien confirm it?

@csadnt: the implementation that is in the same place as the comments is not the whole story. Shape names get transformed some more after that. It's been looked at, and the comments have been improved.
Mar 27, 2013 at 9:37 AM
Edited Mar 27, 2013 at 9:37 AM
"This looks like a regression". Sure, it looks like a regression. But it doesn't tell me if next version will fix it of if it has been decided to do that regression. And if you decided not to support these alternates any more, what's the solution to upgrade a web site that uses these alternates and why is there no warning about it in change history?
Mar 27, 2013 at 5:57 PM
When we say it's a regression, it means it will be a top priority bug and Orchard won't ship without it fixed.
Mar 27, 2013 at 7:15 PM
Ah ok. Great. Sorry for the misunderstanding.