{"id":1361986,"date":"2017-10-11T04:58:31","date_gmt":"2017-10-11T11:58:31","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/"},"modified":"2017-10-11T04:58:31","modified_gmt":"2017-10-11T11:58:31","slug":"multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/","title":{"rendered":"Multisite url import is overwriting diferent events from diff sources (Cont.)"},"content":{"rendered":"<p>Following the previous thread, I&#8217;ve come across some findings that may be helpful to you \/ others.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"Wa0kvxsOkY\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-different-sources\/\">Multisite url import is overwriting diferent events from different sources<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Multisite url import is overwriting diferent events from different sources&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-different-sources\/embed\/#?secret=rbiu1oSN8J#?secret=Wa0kvxsOkY\" data-secret=\"Wa0kvxsOkY\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>The events were being overwritten because in the verification of the event&#8217;s existence on the destination site, it was being based on the Post ID. It is possible to have a tribe_event with post ID: X on site 1, and have a diferent event on site 2 with the same post ID and they are not the same event. This causes that when it imports site 2 it would overwrite the events that had been imported from site 1.<\/p>\n<p>To fix this i used global_id instead.<\/p>\n<p>As I do not know if it has other implications i added a variable:<br \/>\nsrc\/Tribe\/Aggregator\/Record\/Abstract.php &#8211; Line 55 (add mava-fix)<\/p>\n<pre><code>&#039;url&#039; =&gt; array(\n\t\t\t&#039;source&#039; =&gt; &#039;id&#039;,\n\t\t\t&#039;target&#039; =&gt; &#039;EventOriginalID&#039;,\n\t\t\t&#039;mava-fix&#039; =&gt; &#039;global_id&#039;,\n\t\t),<\/code><\/pre>\n<p>As I do not know if it has other implications i added a validation for url only:<br \/>\nsrc\/Tribe\/Aggregator\/Event.php &#8211; Line 191<\/p>\n<pre><code>if ( $fields[ $origin ] === &#039;url&#039; )\n\t\t\t$key = &quot;_{$fields[ $origin ][&#039;mava-fix&#039;]}&quot;; \/\/ mava-fix is \u2018global_id\u2019<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1361986","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>Multisite url import is overwriting diferent events from diff sources (Cont.) -<\/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\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Multisite url import is overwriting diferent events from diff sources (Cont.) -\" \/>\n<meta property=\"og:description\" content=\"Following the previous thread, I&#8217;ve come across some findings that may be helpful to you \/ others. Multisite url import is overwriting diferent events from different sources The events were being overwritten because in the verification of the event&#8217;s existence on the destination site, it was being based on the Post ID. It is possible [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/\" \/>\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\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/\",\"name\":\"Multisite url import is overwriting diferent events from diff sources (Cont.) -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-10-11T11:58:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/#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\":\"Event Aggregator\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/event-aggregator\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Multisite url import is overwriting diferent events from diff sources (Cont.)\"}]},{\"@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":"Multisite url import is overwriting diferent events from diff sources (Cont.) -","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\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/","og_locale":"en_US","og_type":"article","og_title":"Multisite url import is overwriting diferent events from diff sources (Cont.) -","og_description":"Following the previous thread, I&#8217;ve come across some findings that may be helpful to you \/ others. Multisite url import is overwriting diferent events from different sources The events were being overwritten because in the verification of the event&#8217;s existence on the destination site, it was being based on the Post ID. It is possible [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/","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\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/","name":"Multisite url import is overwriting diferent events from diff sources (Cont.) -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-10-11T11:58:31+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/multisite-url-import-is-overwriting-diferent-events-from-diff-sources-cont\/#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":"Event Aggregator","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/event-aggregator\/"},{"@type":"ListItem","position":5,"name":"Multisite url import is overwriting diferent events from diff sources (Cont.)"}]},{"@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\/1361986","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1361986\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1361986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}