You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sebastian Gooren (JIRA)" <ji...@apache.org> on 2016/11/01 17:27:58 UTC
[jira] [Comment Edited] (WICKET-6266) Component resolvers &
variation broken in 7.5.0
[ https://issues.apache.org/jira/browse/WICKET-6266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15626029#comment-15626029 ]
Sebastian Gooren edited comment on WICKET-6266 at 11/1/16 5:27 PM:
-------------------------------------------------------------------
Possible fix: this is only breaking auto-components, so changing the check in {{Component#getMarkup()}} from:
{code:title=current code}
// Markup already determined or preset?
if (markup != null && markupHasCurrentVariation())
{
return markup;
}
{code}
to
{code:title=new code}
// Markup already determined or preset?
if (markup != null && (markupHasCurrentVariation() || isAuto()))
{
return markup;
}
{code}
fixes this edge case.
was (Author: bgooren):
Possible fix: this is only breaking auto-components, so changing the check from:
{code:title=current code}
// Markup already determined or preset?
if (markup != null && markupHasCurrentVariation())
{
return markup;
}
{code}
to
{code:title=new code}
// Markup already determined or preset?
if (markup != null && (markupHasCurrentVariation() || isAuto()))
{
return markup;
}
{code}
fixes this edge case.
> Component resolvers & variation broken in 7.5.0
> -----------------------------------------------
>
> Key: WICKET-6266
> URL: https://issues.apache.org/jira/browse/WICKET-6266
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 7.5.0
> Reporter: Sebastian Gooren
> Attachments: quickstart.zip
>
>
> Auto components fail to render in certain cases due to changes in https://issues.apache.org/jira/browse/WICKET-6231.
> See attached quickstart.
> If you use a component resolver in a page which overrides {{getVariation()}}, but the html file for that page is the "default" one (without the variation in the filename), wicket throws an RTE (MarkupNotFoundException: Markup not found for Component: [WebMarkupContainer [Component id = custom0]]).
> Debugging reveals that this is caused by the change to {{Component#getMarkup()}}. The markup that is set for auto-components might not have the same variation as the html file in which it is used. Because of this, the new {{markupHasCurrentVariation()}} returns {{false}}, and we fall through to the end of {{getMarkup()}}. As the auto-component is dynamically added on each render, {{parent.getMarkup(this)}} returns {{null}} - the markup id gets created on the fly by component resolvers.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)