Skip to content

Instantly share code, notes, and snippets.

@toodooleedoo
Last active August 29, 2015 14:22
Show Gist options
  • Save toodooleedoo/1772f4a11699e8a300fe to your computer and use it in GitHub Desktop.
Save toodooleedoo/1772f4a11699e8a300fe to your computer and use it in GitHub Desktop.
#AEM #Sightly Errors found after 6.1 upgrade

6.1 initial install and testing so far shows it is much more strict on the Sightly Specs Comparison https://github.com/Adobe-Marketing-Cloud/sightly-spec/blob/master/SPECIFICATION.md#1142-comparison-operators

Will update this later to make it more clean only doing a quick POC at the moment from live code running on SP2.

#Invalid syntax for parameter

Runs in 6.0 errors in 6.1 note linkhandler is at https://gist.github.com/toodooleedoo/95e8108b81c2e00b9fea

  <div class="status">
    <a x-cq-linkchecker="skip" data-sly-use.attr="${'../linkhandler.js' @href=${inheritedPageProperties.redirectTarget}" data-sly-attribute="${attr.link}">
      ${properties.name}
    </a>
  </div>

Now it runs in 6.1

  <div class="status">
    <a x-cq-linkchecker="skip" data-sly-use.attr="${'../linkhandler.js' @href=inheritedPageProperties.redirectTarget}" data-sly-attribute="${attr.link}">
      ${properties.name}
    </a>
  </div>

##Another one which does not run in 6.1 as searchRequest was cast as a String in the Java Use-API ###Java Snippet

	private static final String SEARCH_REQUEST = "searchrequest";
	private SearchRequest searchRequest;
	
  searchRequest = (SearchRequest) session.getAttribute(SEARCH_REQUEST);
  
  public SearchRequest getSearchRequest() {
		return searchRequest;
	}

###Sightly Snippets

<span data-sly-test="${header.searchRequest.numberOfSomething > 1}">${'somethinglower' @ i18n}</span>

Right away after removing this or changing ">" to "=" (or run it on SP2) error logs were happy and component rendered. Will have to change Java.

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Invalid types in comparison. Comparison is supported for Number types only
        at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:481)
        at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:533)
        at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment