Wiki Title can not support Chinese

What is the exact behavior?
And what is the error msg from it?

you can view the path like this below. and copy the chinese words to the title: “中文”. and then submit the form. you will get the error message.
http://localhost:8080/qapps/PopcAdmin/Wiki/WikiBlogs?wikiSpaceId=apps

17:20:33.944 ERROR 37277082-153          o.moqui.i.c.MessageFacadeImpl {serviceNamePretty=Org Moqui Impl Wiki Services Create Wiki Blog, form=null, field=title, fieldPretty=Title, serviceName=org.moqui.impl.WikiServices.create#WikiBlog, formPretty=, message=Invalid title (letters, digits, [.,'-_:()!? ] only)}
17:20:33.982  WARN 37277082-153        o.moqui.i.s.ServiceCallSyncImpl Found error(s) when validating input parameters for service org.moqui.impl.WikiServices.create#WikiBlog, so not running service. Errors: Invalid title (letters, digits, [.,'-_:()!? ] only)(for field Title of service Org Moqui Impl Wiki Services Create Wiki Blog
; the artifact stack is:
[name:'component://SimpleScreens/screen/SimpleScreens/Wiki/WikiBlogs.xml/createBlog', type:'AT_XML_SCREEN_TRANS', action:'AUTHZA_VIEW', required: true, granted:true, user:'100000', authz:'AUTHZT_ALWAYS', authAction:'AUTHZA_ALL', inheritable:true, runningTime:0', txId:851]
[name:'component://SimpleScreens/screen/SimpleScreens/Wiki/WikiBlogs.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:true, user:'100000', authz:'AUTHZT_ALWAYS', authAction:'AUTHZA_ALL', inheritable:true, runningTime:0', txId:851]
[name:'component://PopCommerce/screen/PopCommerceAdmin/Wiki.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:true, user:'100000', authz:'AUTHZT_ALWAYS', authAction:'AUTHZA_ALL', inheritable:true, runningTime:0', txId:851]
[name:'component://PopCommerce/screen/PopCommerceAdmin.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:true, user:'100000', authz:'AUTHZT_ALWAYS', authAction:'AUTHZA_ALL', inheritable:true, runningTime:0', txId:851]
[name:'component://webroot/screen/webroot/apps.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:false, user:'null', authz:'null', authAction:'null', inheritable:false, runningTime:0', txId:851]
[name:'component://webroot/screen/webroot.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:false, user:'null', authz:'null', authAction:'null', inheritable:false, runningTime:0', txId:851]

17:20:33.984  WARN 37277082-153      o.moqui.i.c.TransactionFacadeImpl Transaction rollback for [Invalid title (letters, digits, [.,'-_:()!? ] only)(for field Title of service Org Moqui Impl Wiki Services Create Wiki Blog
]. Here is the current location: 
org.moqui.BaseException: Rollback location
        at org.moqui.impl.context.TransactionFacadeImpl.rollback(TransactionFacadeImpl.groovy:475) ~[moqui_temp14901941780230861450WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
        at org.moqui.impl.context.TransactionFacadeImpl.rollback(TransactionFacadeImpl.groovy:447) ~[moqui_temp14901941780230861450WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
        at org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:463) ~[moqui_temp14901941780230861450WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
        at org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:170) ~[moqui_temp14901941780230861450WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
        at org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:118) ~[moqui_temp14901941780230861450WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[moqui_temp3602230749060016WEB-INF_lib_javax.servlet-api-4.0.1.jar.:4.0.1]
        at org.moqui.impl.webapp.ElasticRequestLogFilter.doFilter(ElasticRequestLogFilter.groovy:110) ~[moqui_temp14901941780230861450WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
        at java.lang.Thread.run(Thread.java:829) ~[?:?]
17:20:34.044  INFO 37277082-153           o.moqui.i.s.ScreenRenderImpl Transition apps/PopcAdmin/Wiki/WikiBlogs/createBlog in 919ms, JSON redirect to: /apps/PopcAdmin/Wiki/EditWikiBlog


1 Like

There is a regular experssion check when you have summitted your wiki text to the service.
To avoid this, just search

[.,'-_:()!?

then, remove this check or just comment it out.

Then everything will be ok.

I guess this check here is for a reason, maybe for safety?

1 Like

This constraint is in place because the page name/title is used in the URL. The regex could be improved or other code could be added to avoid characters that will break URLs (unless encoded properly) but still allow non-ASCII characters. I haven’t tried this, but IIRC it could work as UTF-8 encoded URLs are generally supported, ie for non-latin character sets and such.

1 Like