dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
864 stars 466 forks source link

Content Types - Cannot set a Publish/Expire Date field for Widget-Type content types. #11861

Closed joseorsini closed 7 years ago

joseorsini commented 7 years ago

We cannot set an automated Publish/Expire date field to a Widget-Type content type. We're getting error messages in the UI and also on log files.

We should clarify if this is actually something that is supported for this type of content types. As far as the UI concerns, this is possible, however it's not working.

Known Workarounds

None.

Steps to Reproduce (for bugs)

  1. Create a Test Widget content Type.
  2. Add an indexed Date/Time field. Let's call it "Publish Date" .
  3. On the content type properties, set "Publish Date" as the Publish Date field property.
  4. Exception is thrown:
[09/06/17 16:51:48:114 EDT] ERROR action.EditStructureAction: java.lang.IllegalArgumentException: publishDateVar cannot be set for class com.dotcms.contenttype.model.type.ImmutableWidgetContentType
java.lang.IllegalArgumentException: publishDateVar cannot be set for class com.dotcms.contenttype.model.type.ImmutableWidgetContentType
at com.dotcms.repackage.com.google.common.base.Preconditions.checkArgument(Preconditions.java:88) ~[dot.guava-11.0.1_2.jar:?]
at com.dotcms.contenttype.model.type.ContentType.check(ContentType.java:68) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.model.type.ImmutableWidgetContentType.validate(ImmutableWidgetContentType.java:1576) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.model.type.ImmutableWidgetContentType.access$4500(ImmutableWidgetContentType.java:36) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.model.type.ImmutableWidgetContentType$Builder.build(ImmutableWidgetContentType.java:1974) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.transform.contenttype.ImplClassContentTypeTransformer.transformToSubclass(ImplClassContentTypeTransformer.java:33) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.transform.contenttype.ImplClassContentTypeTransformer.<init>(ImplClassContentTypeTransformer.java:22) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.transform.contenttype.StructureTransformer.transformToContentType(StructureTransformer.java:196) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.transform.contenttype.StructureTransformer.<init>(StructureTransformer.java:35) ~[dotcms_4.1.0_999999.jar:?]
at com.dotcms.contenttype.transform.contenttype.StructureTransformer.<init>(StructureTransformer.java:27) ~[dotcms_4.1.0_999999.jar:?]
at com.dotmarketing.portlets.structure.factories.StructureFactory.saveStructure(StructureFactory.java:402) ~[dotcms_4.1.0_999999.jar:?]
at com.dotmarketing.portlets.structure.action.EditStructureAction._saveStructure(EditStructureAction.java:372) [dotcms_4.1.0_999999.jar:?]
at com.dotmarketing.portlets.structure.action.EditStructureAction.processAction(EditStructureAction.java:108) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:128) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:116) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portlet.CachePortlet.processAction(CachePortlet.java:130) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portal.action.LayoutAction._processPortletRequest(LayoutAction.java:232) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portal.action.LayoutAction._processActionRequest(LayoutAction.java:249) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:93) [dotcms_4.1.0_999999.jar:?]
at com.dotcms.repackage.org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) [dot.struts-1.2.4_2.jar:1.2.4]
at com.dotcms.repackage.org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) [dot.struts-1.2.4_2.jar:1.2.4]
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:128) [dotcms_4.1.0_999999.jar:?]
at com.dotcms.repackage.org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) [dot.struts-1.2.4_2.jar:1.2.4]
at com.dotcms.repackage.org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) [dot.struts-1.2.4_2.jar:1.2.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) [servlet-api.jar:?]
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:281) [dotcms_4.1.0_999999.jar:?]
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:510) [dotcms_4.1.0_999999.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotcms.repackage.com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:135) [dot.secure-filter-ukv_2.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotmarketing.filters.CMSFilter.doFilter(CMSFilter.java:265) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotcms.filters.interceptor.AbstractWebInterceptorSupportFilter.doFilter(AbstractWebInterceptorSupportFilter.java:73) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotcms.filters.interceptor.AbstractWebInterceptorSupportFilter.doFilter(AbstractWebInterceptorSupportFilter.java:73) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotmarketing.cms.urlmap.filters.URLMapFilter.doFilter(URLMapFilter.java:308) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotcms.repackage.org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:404) [dot.urlrewritefilter-4.0.3_2.jar:4.0.3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotmarketing.filters.TimeMachineFilter.doFilter(TimeMachineFilter.java:134) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotmarketing.filters.ThreadNameFilter.doFilter(ThreadNameFilter.java:90) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotmarketing.filters.CookiesFilter.doFilter(CookiesFilter.java:33) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at com.dotmarketing.filters.CharsetEncodingFilter.doFilter(CharsetEncodingFilter.java:110) [dotcms_4.1.0_999999.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.18]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.18]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [catalina.jar:8.0.18]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.18]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [catalina.jar:8.0.18]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [catalina.jar:8.0.18]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.18]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) [catalina.jar:8.0.18]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:673) [catalina.jar:8.0.18]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.18]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) [catalina.jar:8.0.18]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086) [tomcat-coyote.jar:8.0.18]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659) [tomcat-coyote.jar:8.0.18]
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) [tomcat-coyote.jar:8.0.18]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558) [tomcat-coyote.jar:8.0.18]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515) [tomcat-coyote.jar:8.0.18]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.18]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
screen shot 2017-06-09 at 2 53 50 pm

Context

Reported by customer: https://my.dotcms.com/tickets/detail.dot?id=0ffd6151-ad6b-49d1-a6f4-2145ca8b64eb

Your Environment

erickgonzalez commented 7 years ago

PR https://github.com/dotCMS/core/pull/11879

bryanboza commented 7 years ago

We still having the same problem but now with the others content types

Log: https://gist.github.com/bryanboza/5ad45e107725df3473e0feb4c09fd665

erickgonzalez commented 7 years ago

PR: https://github.com/dotCMS/core/pull/11897

erickgonzalez commented 7 years ago

PR with the requested changes https://github.com/dotCMS/core/pull/11904

bryanboza commented 7 years ago

Fixed now this works in all the content types, also tested pushing this kind of content types and works as expected... Tested on release-4.1.1 // Postgres