Enonic version: 6.15.5
OS: Win10 64x
Hello there Enonic Dicuss community.
I am upgrading my enonic version and i’d migrate an entire project based on enonic 6.4 yo enonic 6.15 and it seems to work well but the console is showing two errors.
TypeError: contentLib.publish is not a function. This error apperas when I refresh my site after the session expires
TypeError: portal.sanitizeHtml is not a function. This error appear while im trying to create some content from my site.
I think that that error could be related with the libraries that Im calling or how Im doing the calls. Bellow Im sharing this information. If more information is needed let me know.
This is the configuration of my build.gradle
plugins {
id ‘java’
id ‘com.enonic.xp.app’ version ‘1.2.0’
}
xp {
version = xpVersion
}
app {
name = project.ext.appName
displayName = project.ext.displayName
vendorName = ‘Enonic AS’
vendorUrl = ‘http://enonic.com’
systemVersion = “${xpVersion}”
}
dependencies {
compile “javax.servlet:javax.servlet-api:3.0.1”
compile “com.enonic.xp:core-api:${xpVersion}”
compile “com.enonic.xp:portal-api:${xpVersion}”
include “com.enonic.xp:lib-content:${xpVersion}”
include “com.enonic.xp:lib-portal:${xpVersion}”
include “com.enonic.xp:lib-thymeleaf:${xpVersion}”
//include “com.enonic.xp:lib-xslt:${xpVersion}”
//include “com.enonic.xp:lib-mustache:${xpVersion}”
include “com.enonic.xp:lib-i18n:${xpVersion}”
include “com.enonic.xp:lib-auth:${xpVersion}”
//include “com.enonic.xp:lib-cache:${xpVersion}”
//include “com.enonic.xp:lib-context:${xpVersion}”
//include “com.enonic.xp:lib-http-client:${xpVersion}”
//include “com.enonic.xp:lib-io:${xpVersion}”
include “com.enonic.xp:lib-mail:${xpVersion}”
compile “org.apache.poi:poi:3.9”
compile “org.apache.poi:poi-ooxml:3.9”
compile ‘com.google.apis:google-api-services-analytics:v3-rev159-1.25.0’
compile ‘com.google.api-client:google-api-client:1.27.0’
include “com.enonic.xp:lib-websocket:${xpVersion}”
include “com.enonic.lib:util:1.0.0”
include ‘com.enonic.lib:menu:1.2.0’
include ‘com.squareup.okhttp:okhttp:2.5.0’
include “com.enonic.lib:lib-http-client:1.0.0”
include “com.enonic.xp:lib-io:${xpVersion}”
include ‘com.enonic.lib:geoip:1.0.0’
}
repositories {
mavenLocal()
jcenter()
xp.enonicRepo()
}
This is how I call the lib
var portal = require(’/lib/xp/portal’);
var contentLib = require(’/lib/xp/content’);
This is where im calling the function sanitizeHtml
…
var createHubCategory = contentLib.create({
name: portal.sanitizeHtml(name).replace(/([.*+/?^=:${}()|[]/\])/g, “”) + dateNow,
parentPath: portal.getSite()._path + ‘/consultorio-data/consultorio-categoria’,
displayName: portal.sanitizeHtml(name),
…
…
…
Hope that you could bring to me some orientation.
Thank you-