{"id":867890,"date":"2014-11-07T17:36:19","date_gmt":"2014-11-08T01:36:19","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/issue-with-required-fields\/"},"modified":"2015-01-08T05:21:12","modified_gmt":"2015-01-08T13:21:12","slug":"issue-with-required-fields","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/","title":{"rendered":"Issue with Required Fields."},"content":{"rendered":"<p>Hello,<br \/>\nI&#8217;ve followed this: https:\/\/theeventscalendar.com\/change-required-fields-on-community-event-submission-page\/ in order to require specific fields on the submission page. Specifically, the Organizer Email field.<br \/>\nThe issue that I&#8217;m seeing is that when a notification comes in and I click the Review Event link I&#8217;m taken to the front-end submission details page. When I click the submit button on that page, I get a warning stating that the organizer&#8217;s email is required. Looking down at the organizer section I see that it is using a previously saved organizer. After looking into that specific organizer&#8217;s information I see that an email address exists for that user.<\/p>\n<p>Why am I getting this error even though the organizer&#8217;s email exists?<\/p>\n<p>Here is what I have added to my functions.php file:<br \/>\nadd_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;my_community_required_fields&#8217;, 10, 1 );<\/p>\n<p>function my_community_required_fields( $fields ) {<br \/>\n\t$fields = array(<br \/>\n\t\t&#8216;post_title&#8217;,<br \/>\n\t\t&#8216;post_content&#8217;,<br \/>\n\t\t&#8216;EventCurrencySymbol&#8217;,<br \/>\n\t\t&#8216;EventURL&#8217;,<br \/>\n\t\t&#8216;EventStartDate&#8217;,<br \/>\n\t\t&#8216;venue&#8217;,<br \/>\n\t\t&#8216;organizer&#8217;<br \/>\n\t);<\/p>\n<p>\t\/\/ Requiring the organizer email (or other &#8220;square bracketed&#8221;<br \/>\n\t\/\/ fields) can&#8217;t be done using the above approach, but we can<br \/>\n\t\/\/ simply test within the $_POST superglobal directly.<br \/>\n\t\/\/<br \/>\n\t\/\/ If a field hasn&#8217;t been populated then we simply add a requirement<br \/>\n\t\/\/ using a field name we know doesn&#8217;t exist, but can be used to form<br \/>\n\t\/\/ a meaningful error message (if the org email is missing the user<br \/>\n\t\/\/ will see &#8220;Organizer Email is required&#8221;).<br \/>\n\t\/\/<br \/>\n\t\/\/ You could take this a step further and additionally validate the<br \/>\n\t\/\/ email field to ensure it looks like a valid email address and<br \/>\n\t\/\/ provide an alternative error using the same approach.<br \/>\n\tif ( empty( $_POST[&#8216;organizer&#8217;][&#8216;Email&#8217;] ) )<br \/>\n\t\t$fields[] = &#8216;Organizer Email&#8217;;<\/p>\n<p>\treturn $fields;<br \/>\n}<\/p>\n","protected":false},"template":"","class_list":["post-867890","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Issue with Required Fields. -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Issue with Required Fields. -\" \/>\n<meta property=\"og:description\" content=\"Hello, I&#8217;ve followed this: https:\/\/theeventscalendar.com\/change-required-fields-on-community-event-submission-page\/ in order to require specific fields on the submission page. Specifically, the Organizer Email field. The issue that I&#8217;m seeing is that when a notification comes in and I click the Review Event link I&#8217;m taken to the front-end submission details page. When I click the submit button on that [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-01-08T13:21:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/\",\"name\":\"Issue with Required Fields. -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2014-11-08T01:36:19+00:00\",\"dateModified\":\"2015-01-08T13:21:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Issue with Required Fields.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Issue with Required Fields. -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/","og_locale":"en_US","og_type":"article","og_title":"Issue with Required Fields. -","og_description":"Hello, I&#8217;ve followed this: https:\/\/theeventscalendar.com\/change-required-fields-on-community-event-submission-page\/ in order to require specific fields on the submission page. Specifically, the Organizer Email field. The issue that I&#8217;m seeing is that when a notification comes in and I click the Review Event link I&#8217;m taken to the front-end submission details page. When I click the submit button on that [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/","article_modified_time":"2015-01-08T13:21:12+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/","name":"Issue with Required Fields. -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2014-11-08T01:36:19+00:00","dateModified":"2015-01-08T13:21:12+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/issue-with-required-fields\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"Issue with Required Fields."}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/867890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/867890\/revisions"}],"predecessor-version":[{"id":930378,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/867890\/revisions\/930378"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=867890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}