Bug 101723 - Public template used for all contexts
Summary: Public template used for all contexts
Alias: None
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other   
(Show other bugs)
Version: nightly
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
Depends On:
TreeView+ depends on / blocked
Reported: 2003-08-06 07:02 UTC by redhatcms
Modified: 2007-04-18 16:56 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-09-05 17:56:21 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description redhatcms 2003-08-06 07:02:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2)
Gecko/20030208 Netscape/7.02

Description of problem:
Templates can be created and associated with specific 'contexts' for a
particular CMS content type - e.g. an 'xml' template can be associated with the
alternate context.

This template should be used to render items of this type when previewing and
publishing. In the referenced build the default template associated with the
'public' context of a content type is used for all contexts. As a side-effect
only one template can be used to render a content type.

Version-Release number of selected component (if applicable):
29th July 2003 Nightly

How reproducible:

Steps to Reproduce:
1.Create a default template for the 'alternate' context
2.Preview or publish an instance of that content type.

Actual Results:  The default public template is used.

Expected Results:  The newly created template should be used.

Additional info:

I have narrowed the problem down to 2 source files:
The class com.arsdigita.cms.dispatcher.AbstractTemplateResolver should be
checking for a HTTP parameter called 'templateContext' not just an attribute
called this as it does currently.
e.g. the corrected code is similiar to -

String context = (String)request.getAttribute("templateContext");

if ( context == null ) {
        context = (String) request.getParameter("templateContext");

Currently it does not check for the parameter. This parameter is the mechanism
used by the HttpHTMLProvider class when publishing.

Also it appears that the getTemplateFromURL() within the AbstractItemResolver
class should check if 'preview' is the first token when attemping to locate the
context. Currently it incorreclty returns null for the context when previewing.

Comment 1 Jon Orris 2006-09-05 17:56:21 UTC
Closing old tickets

Note You need to log in before you can comment on or make changes to this bug.