[MGNLETK-88] MultiSiteFilter logs confusing warnings Created: 07/Nov/12  Updated: 16/Sep/15  Resolved: 16/Sep/15

Status: Closed
Project: Extended Templating Kit (closed)
Component/s: multisite
Affects Version/s: 2.0.4
Fix Version/s: 2.0.7

Type: Bug Priority: Minor
Reporter: Frank Sommer Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

If the dialogs.js is requested, the MultiSiteFilter logs the following confusing warning. I think there are no reason for doing that.

WARN   info.magnolia.module.extendedtemplatingkit.filters.MultiSiteFilter 07.11.2012 12:35:55 -- No path or repository defined. Not possible to search an associated site for this uri: /.resources/admin-js/dialogs/dialogs.js


 Comments   
Comment by Jan Haderka [ 07/Nov/12 ]

Indeed, there's no reason to emit this warning for /.resources/*.
Thanks for the report.

Comment by Jan Haderka [ 06/Dec/12 ]
+            if (!uri.startsWith("/.resources/")) {

explicitly excluding resources from check is not correct. Same situation can occur also if template or script is requested by dialog.
The correct check should be

if (StringUtils.isBlank(mgnlPath) || StringUtils.isBlank(mgnlRepository)) {

and even in this case I believe the message should be logged only at debug level.

Comment by Markus Jeni [ 24/Mar/14 ]

Problem not resolved in 2.0.17:
Right condition was added but logging the same message in if and else case is wrong.

info.magnolia.module.extendedtemplatingkit.filters.MultiSiteFilter
112:   private Site getSiteForDialog(HttpServletRequest request, String domain, String uri) {
113:        Site site = null;
114:        String mgnlPath = request.getParameter(InterceptFilter.PARAM_PATH);
115:        String mgnlRepository = request.getParameter(InterceptFilter.PARAM_REPOSITORY);
116:
117:        if(StringUtils.isNotBlank(mgnlPath) && StringUtils.isNotBlank(mgnlRepository) && RepositoryConstants.WEBSITE.equals(mgnlRepository)) {
118:            Node node = SessionUtil.getNode(mgnlRepository, mgnlPath);
119:            site = siteManager.getAssignedSite(node);
120:            log.debug("Site "+site.getName()+" is linked to the content "+mgnlPath+" for the dialog "+uri);
121:        } else {
122:            site = siteManager.getAssignedSite(domain, uri);
123:            if (StringUtils.isBlank(mgnlPath) || StringUtils.isBlank(mgnlRepository)) {
124:                log.debug("No path or repository defined. Not possible to search an associated site for this uri: "+uri);
125:            } else {
126: ==>            log.warn("No path or repository defined. Not possible to search an associated site for this uri: "+uri);
127:            }
128:        }
129:
130:        return site;
131:   }
Comment by Roman Kovařík [ 16/Sep/15 ]

Hello Marcus,
a fix which has been already released can't be reopened. Please create a follow up issue.

Regards
Roman.

Generated at Mon Feb 12 01:48:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.