Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • I also noticed that the ‘deauthorize and reset the plugin’ link had no effect.

    However when i used the ‘reset’ link on the main plugins page the plugin was deauthorised correctly and i could re-add the correct analytics account.

    • This reply was modified 7 years, 5 months ago by georgiePorg.

    i also tried adding the whitespace in the the-events-calendar.class.php in the function events_search_join and that did the job too..

    here’s the function if you want to change it there and try.

    /**
    		 * join filter for standard wordpress templates.  Adds the postmeta tables for start and end queries
    		 *
    		 * @param string join clause
    		 * @return string modified join clause
    		 */
    		public function events_search_join( $join ) {
    			global $wpdb;
    			if( !$this->in_event_category() ) {
    				return $join;
    			}
    			$join .= " LEFT JOIN {$wpdb->postmeta} as eventStart ON( {$wpdb->posts}.ID = eventStart.post_id ) ";
    			$join .= " LEFT JOIN {$wpdb->postmeta} as eventEnd ON( {$wpdb->posts}.ID = eventEnd.post_id ) ";
    			return $join;
    		}

    all i did was add a whitespace in front of the LEFT JOIN bit of the query

    I also have the WPML Multilingual CMS installed and I noticed that when click on the View all Events, the events list comes up empty..

    Think i found the problem here:
    I had a look at the SQL statement that was being generated and for me it generated the following:

    SELECT SQL_CALC_FOUND_ROWS wp_posts.*, eventStart.meta_value as EventStartDate, eventEnd.meta_value as EventEndDate FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_post','post_page') JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1LEFT JOIN wp_postmeta as eventStart ON( wp_posts.ID = eventStart.post_id ) LEFT JOIN wp_postmeta as eventEnd ON( wp_posts.ID = eventEnd.post_id ) WHERE 1=1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('6') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND t.language_code='en' AND ( eventStart.meta_key = "_EventStartDate" AND eventEnd.meta_key = "_EventEndDate" ) AND ( eventStart.meta_value > "2011-02-24 9:57:37" OR ( eventStart.meta_value < "2011-02-24 9:57:37" AND eventEnd.meta_value > "2011-02-24 9:57:37" ) ) GROUP BY wp_posts.ID ORDER BY eventStart.meta_value ASC LIMIT 0, 10

    now it seems that there is missing a whitespace between the join for the language code and the join for the event start date.
    not sure if it’s the right solution, but i just added a whitespace to the end of the JOIN statements in the function posts_join_filter in sitepress-multilingual-cms/sitepress.class.php. Suddenly the list now shows up. There might be a better fix.. But i’m not sure who is responsible for the whitespace here..?

    I am also experiencing problems with the listview, but this hack doesn’t fix this. I will let you know when i’ve dug into that problem.

    quite simply the-events-calendar is hard coded for one language.

    at the start of function addEventMeta() it makes a call to:

    $category_id = $this->create_category_if_not_exists();

    this basically always returns the id for a category called ‘Events’.. So if you are making events in Spanish then you would need to return a category ‘Eventos’ or alike.

    My solution was to simply remove this first call to retrieve the category ‘Events’
    and later removed the line which merges this Event with the currently enabled events

    // merge event category into this post
    				$cats = wp_get_object_terms($postId, 'category', array('fields' => 'ids'));
    				//$new_cats = array_merge( array( get_category( $category_id )->cat_ID ), $cats );
    
     wp_set_post_categories( $postId, /*$new_cats*/$cats );

    So this does mean that he/she who is making the post will have to manually add the event to the ‘Event’ or ‘Eventos’ categoy manually.. but it should work.

    hope this helps.

    Yes, i found the problem..

    It’s a bug in the events-calendar plugin i think…. it’s like this:

    everytime you added a new event, or updated it there was a
    write to the ‘wp_term_relationships’ table in the sql database.. basically entering a relationship between the post id and the event category in the default language and then also to the ‘Eventos’ category (if say you have spanish as your second language) i.e. the non-default language. So it seemed that every event was an english event and a spanish one..

    If you want to you can edit the sql database to view the rouge relationship (and also remove it) between your post and the english category (for all non-english events).. This can be done by say using the MYSql query browser and using the interface to remove the first entry from the wp_term_relationships table with the id of the post… This should fix it for any posts you have already added…

    So this is the cause of the problem… just looking at a fix now.. it seems the rouge call which adds the category entry in english is in the-events-calendar.class.php… line 901 when it calls wp_set_post_categories( $postId, $new_cats );

    I will look more into a fix.. but of course you are also willing to try if you like..

    I have also noticed the same thing.. i’m currently looking into a way of making at least the event listing filter on language..

Viewing 8 replies - 1 through 8 (of 8 total)