Conversation
If I understand the code correctly this would for all DSL based items inherit the full stateDescription from the linked channel-type and then render a state even if the user set the label of the item to be w/o a pattern. According to the discussion in #3741 the idea was to somehow migrate the items files and add a dedicated |
Updating the DSL to split label and pattern is not the object of this PR. |
PR ready, I added two tests for options. |
@@ -412,6 +414,53 @@ public StateDescription getStateDescription(Locale locale) { | |||
return null; | |||
} | |||
|
|||
@Override | |||
public StateDescription getMixedStateDescription() { | |||
return getMixedStateDescription(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JavaDoc tells the default locale is used. You pass in null
here instead. Please also review the getStateDescription
method which behaves analogous. Alternatively the JavaDoc in Item
should be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done the same thing as for getStateDescription
. It looks like it exists a mechanism to define pattern in channel for different languages ? We don't care about the locale here, I have no idea if it is a bug or not. I would suggest to open a new issue if there is a problem with that.
...which should work seamlessly with this PR. Nonetheless does it also change the current behaviour on item rendering by inheriting the state pattern from the channel-type. This will change a lot of sitemap entries. |
What is changed by the other PR is that now |
So what does this one exactly do/fix? I am also very surprised by changed to core classes such as GenericItem, which we should really avoid whenever possible. And a new method like |
To my understanding it builds a state description by mixing the properties contributed by several/all providers. For each property, the non-null value from the provider with the highest ranking will be used. As I already pointed out in #3822 (comment), I'm pretty sure this will lead to funny surprises and therefore IMHO is not a good idea to do. |
Hey guys, I try to address the problem that was discussed in the original issue. The current method does not return the channel options in case you have a state description that is provided by the item provider that has a higher priority (for example with a pattern in the item label). |
In case it is still not clear, this PR fixes issue #2729 , display of mapped option value. |
That being said, using |
Signed-off-by: Henning Treu <henning.treu@telekom.de>
@lolodomo I can follow your arguments and your code does indeed fix the original problem. My concerns are in the direction of @kaikreuzer and @SJKA: by introducing a new wdyt? |
What you are doing is exactly what I was doing except that you do the mix only for the options. |
Yes, my proposal is to only fix the options issue with the same method as you did. But leave the rest as is which gives us the opportunity to come up with a good concept on how to provide consistent state descriptions (if this is still an issue then). |
Before I change my code, is htreu's proposal ok for everybody ? |
@SJKA @kaikreuzer : is it ok for you if I change |
Can I have a feedback so that I can finish this bug fix ? |
Fix issue #2729 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Ok, done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Fix issue #2729
Signed-off-by: Laurent Garnier lg.hc@free.fr