WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
Compatibility with WordPress 3.1 ? (24 posts)

  1. Marcoconut
    Member
    Posted 3 years ago #

    Hello,
    I've upgrade WordPress to 3.1 today and since this update the plug in The Events Calendar don't work anymore.
    I've change the single.php, list.php etc to fit my theme and put all these files in a folder 'events' directly in my theme folder and it always worked but since the update the events page (list) or the calendar work as usual but now when i click on a date the article don't appear. I just got the excert of the article in the bottom of the events list. It's like since the update of wordpress 3.1 the page http://www.mysite.org/events/thearticle is not considered like an article.
    I tried to change settings in the single.php file but it's still the same so i've disable the plugin.
    Does anyone have the same issue ?
    Thanks for your answers.

  2. imkane
    Member
    Posted 3 years ago #

    Yes, same issue here. When I click on an event in the calendar it shows the correct URL in the address bar but the full calendar is displayed rather than the event post.

    :(

  3. joemcgill
    Member
    Posted 3 years ago #

    I've had the same problem. I've been able to confirm that this issue was specifically related to the 3.1 upgrade.

  4. joemcgill
    Member
    Posted 3 years ago #

    Apparently this has something to do with the way the plugin is rewriting the permalinks. When I changed my permalink structure to the default 'Day and name' or 'Month and name' settings it starts to work again.

  5. bleggate
    Member
    Posted 3 years ago #

    Hi Guys

    Same problem here. It is since the upgrade to 3.1 also.

    This is an integral part of my site and I really want this to work.

    If you have any solutions I would love to hear them.

    Can I change only the permalink structure for the events calendar or will this change the whole site.
    I use the permalink structure of category and post name at the moment and naturally with over 400 indexed pages I do not want to change this.

    A solution would be good and I am all ears.
    Thanks in advance.

  6. w03d
    Member
    Posted 3 years ago #

    As joemcgil said, take a look at http://wordpress.org/support/topic/31-rewrites, it may help.

  7. joemcgill
    Member
    Posted 3 years ago #

    Hey w03d - can you elaborate on how you implemented the fix code:
    remove_filter('template_redirect', 'redirect_canonical');

    Do you add it to the __construct() function, or where?

  8. Ryan Boren
    WordPress Dev
    Posted 3 years ago #

    There are many event calendar plugins. Could you link to the one you are using? Also, which permalink structure exhibits the problem? Which web server are you using? Apache, IIS6, IIS7, IIS7.5?

  9. joemcgill
    Member
    Posted 3 years ago #

    Hey Ryan, the plugin is actually called 'The Events Calendar' - http://wordpress.org/extend/plugins/the-events-calendar/ (creative right?)

    I think I've narrowed down the issue to the rewrite function that the plugin calls by using add_filter( 'generate_rewrite_rules' ... (line 335 in the-events-calendar.class.php if you're looking at the code).

    The actual rewrite function is this:

    public function filterRewriteRules( $wp_rewrite ) {
    			if( $useRewriteRules = eventsGetOptionValue('useRewriteRules','on') == 'off' ) {
    				return;
    			}
    			$categoryId = get_cat_id( The_Events_Calendar::CATEGORYNAME );
    			$eventCategory = get_category( $categoryId );
    			$eventCats = array( $eventCategory );
    			$childCats = get_categories("hide_empty=0&child_of=$categoryId");
    			$eventCats = array_merge( $eventCats, $childCats );
    			$newRules = array();
    			foreach( $eventCats as $cat ) {
    				$url = get_category_link( $cat->cat_ID );
    				$base = str_replace( trailingslashit( get_option( 'siteurl' ) ), '', $url );
    				$newRules[$base . 'month'] 					= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=month';
    				$newRules[$base . 'upcoming/page/(\d+)']	= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=upcoming&paged=' . $wp_rewrite->preg_index(1);
    				$newRules[$base . 'upcoming']				= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=upcoming';
    				$newRules[$base . 'past/page/(\d+)']		= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=past&paged=' . $wp_rewrite->preg_index(1);
    				$newRules[$base . 'past']					= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=past';
    				$newRules[$base . '(\d{4}-\d{2})$']			= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=month' .'&eventDate=' . $wp_rewrite->preg_index(1);
    				$newRules[$base . '?$']						= 'index.php?cat=' . $cat->cat_ID . '&eventDisplay=' . eventsGetOptionValue('viewOption','month');
    			}
    		  $wp_rewrite->rules = $newRules + $wp_rewrite->rules;
    		}

    The only time this breaks is when permalinks have been set to include the category name in the URL (i.e. /%category%/%postname%).

  10. imkane
    Member
    Posted 3 years ago #

    @Ryan - http://wordpress.org/extend/plugins/the-events-calendar/, /%category%/%postname%/, Apache

  11. Ryan Boren
    WordPress Dev
    Posted 3 years ago #

    A change in 3.1 is tripping up the plugin's in_event_category( ) function. 3.1 now sets the 'cat' query var when resolving /%category%/%postname%/ permalinks. 3.0 did not.

    A quick fix is to change this block of code in in_event_category():


    if( $cat_id == $this->eventCategory() ) {
    return true;
    }

    to this:


    if( !is_singular && $cat_id == $this->eventCategory() ) {
    return true;
    }

    We'll look at fixing this in WP for 3.1.1.

  12. imkane
    Member
    Posted 3 years ago #

    @Ryan - you rock! Thanks so much.

  13. Ryan Boren
    WordPress Dev
    Posted 3 years ago #

  14. dcdblu
    Member
    Posted 3 years ago #

    Ryan -
    re: quick fix
    What file is the above block of text found in?

  15. joemcgill
    Member
    Posted 3 years ago #

    Thanks Ryan,

    That fixes the issue with single post pages but doesn't fix (what I assume is a related issue) with 'previous' or 'next' posts on the list page when the Event plugin is in "pretty URL mode."

    Turning off that mode fixes the issue and will work for now until things get patched up.

  16. joemcgill
    Member
    Posted 3 years ago #

    @dcdblu - the line Ryan edited above is in the plugin file /the-events-calendar/the-events-calendar.class.php on line 684.

  17. bleggate
    Member
    Posted 3 years ago #

    Thank you Thank you Thank you.

    This is exactly what I have been after. Works 100% for me with a child theme, on genesis on wordpress 3.1

    Thank you Ryan you are a legend!

  18. nimetmurji
    Member
    Posted 3 years ago #

    Hello there everyone,

    I'm new to word press, and i was wondering if anyone can help me to install a plugging

    i have my blog on wordpress site itself, and it doesn't have pluggin option, so how do i upload a plugin? plz help

    or if anyone can do it for me i'll be very glad, i need a comment push notification pluggin on my blog.

    Thanks

  19. bleggate
    Member
    Posted 3 years ago #

    Hi Nimetmurji

    Great question and easy to get overwhelmed when you first start.

    First off I would reccommend opening a new topic for your post as it does not relate to this compatability question.

    To upload a new plugin visit your plugins page with in your wordpress dashboard and go to add new plugin..
    Type in the search box what you are looking for and search. When you think you have found what you want install it, activate it and then follow the plugins reccomendations.

    A short and brief answer. If you would like more open a new topic.

    Good luck

    Benji

  20. nimetmurji
    Member
    Posted 3 years ago #

    Thanks Benji,

    But i know of that procedure, my problem is, i can not see pluggin option on my current dashboard, its available of earlier versions like 2.1

    Please advice

  21. bleggate
    Member
    Posted 3 years ago #

    No idea about earlier versions as I always look to use the most uptodate version of WordPress as there are alwasy security updates and advances in user interphase.

    Please start a new thread for this enquiry.

  22. nimetmurji
    Member
    Posted 3 years ago #

    I meant to say, i'm not using the earlier version which had option for plugins on dashoard, the new version doesn't have...nwaz thanks i have started a new post ;-)

  23. Shane Pearlman
    Modern Tribe
    Plugin Author

    Posted 3 years ago #

    Hi Everyone,

    Been quite a while. We will add the patch the the core plugin and do a small release in the next couple days. Just an FYI. Still not doing any real support on this plugin right now as we have a huge update coming in a few month, but this is a must patch.

  24. thrilom
    Member
    Posted 3 years ago #

    I have a huge issue with "The Events Calendar" my site is promotersgala.com I have had this plugin on my site for my upgrade to wp 3.1 and it was working fine until I tried to add my sidebar and I also changed the div id and class wrapping the calendar to id="main-content" and class="main-content-other" I am using the Reviewit theme and also buddy press. The first issue is that the calendar suddenly appears on my home page and not my post widget. I cant get rid on the calendar unless i deactivate it. Also my widget displaying "Industry professionals" breaks as well it takes you to a calendar page when it should take you to the users website/profile. Please help I need this back to normal. Id even down grade my wp back to 3.0.5 or something to get it back to the way it was.

    I am using permalink structure: /%post_id%/%postname%

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic