WordPress.org

Ready to get started?Download WordPress

Forums

Cannot redeclare is_rtl (64 posts)

  1. snumb130
    Member
    Posted 3 years ago #

    Help me out guys. I am working on Events Calendar plugin and I am getting an error with 3.0 and can't figure it out. It has to do with trying to instantiate the WP_Locale.

    I was using $wp_locale = new WP_Locale() and getting this error.

    I tried using $wp_locale global but then I am getting error of it being a non-object when calling $wp_locale->get_weekday(0);

    Help me out.

  2. snumb130
    Member
    Posted 3 years ago #

    Sorry I should have been more clear. Check out development plugin at http://svn.wp-plugins.org/events-calendar/trunk

  3. snumb130
    Member
    Posted 3 years ago #

    Any suggestions?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Might this have a better chance of a response if it was moved to WP-Advanced? I can move it for you, if you want.

  5. snumb130
    Member
    Posted 3 years ago #

    If you would move it for me, that would be great. Thanks.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Consider it moved.

  7. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

  8. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    In greater detail:

    In 2.9, we loaded locale.php using require_once. In 3.0, we standardized a few calls, including this one, to require. Thus, in 2.9, when the plugin included locale.php way too early (on immediate include, not even on a hook), WordPress let it ride as it was told to only include locale.php once, if it wasn't included already.

    The fix would be to stop including locale.php the way the plugin does. It should be entirely unnecessary, though I admittedly haven't looked deeply into the plugin.

    Alternatively, wait until the locale is already loaded before trying to do new WP_Locale. A plugin realistically should be waiting until the init hook for everything anyway -- that would solve the problem here.

  9. byronrode
    Member
    Posted 3 years ago #

    Hi guys.

    I managed to get a quick work around to allow the calendar to load using WP 3.0 but when navigating months using the Large Calendar, it breaks the links for prev/next months.

    To fix the error:
    I removed the "require_once(ABSWPINCLUDE.'/locale.php');" call on line 85 on events-calendar.php.
    Changed line 333's add_action hook from 'plugins_loaded' to 'init'

    Am investigating the navigation controls going missing.

  10. byronrode
    Member
    Posted 3 years ago #

    Ok just to follow up:

    To get the calendar to load correctly I needed to load the WP_Locale class in the actual EC_Calendar::__construct method.

    function __construct() {
    		require_once(ABSWPINCLUDE.'/locale.php');
    		$this->locale = new WP_Locale;
    	}

    This is working fine, but when clicking on the previous or next month link in the large calendar, the calendar updates fine but the jQuery functions are not being loaded correctly.

    Using Firebug, I can see that the GET request correctly pulls the data through, but the jQUery is being removed and as such, it does not load any extra events or loads the updated next and previous links. I am still investigating and will feedback any changes that I notice.

    I must also state that this is only for the large calendar in the front-end. The backend calendar is working correctly so far, but I am not sure about the listing of events or the sidebar widget, as these are elements of the plugin that we do not use.

  11. byronrode
    Member
    Posted 3 years ago #

    Ok so I have fixed the large calendar using the above techniques, and managed to solve the jQuery issue, by changing the html that was appended to the calendar.

    ecd.jq('#EC_previousMonthLarge')
    	.append("«&nbsp;<?php echo ucfirst($this->get_incrMonth($m-1));?>")
    	.mouseover(function() {
    		ecd.jq(this).css('cursor', 'pointer')
    		})
    	.live('click', function() {
    		ecd.jq('#EC_ajaxLoader').show('slow');
    		ecd.jq.get("<?php bloginfo('siteurl');?>/index.php",
            {EC_action: "switchMonthLarge", EC_month: "<?php echo $m-1;?>", EC_year: "<?php echo $y;?>"},
            function(ecdata) {
    			ecd.jq('#EC_ajaxLoader').hide('slow');
              	ecd.jq('#calendar_wrapLarge').empty().append( ecdata );
            });
          });
    
    ecd.jq('#EC_nextMonthLarge')
    	.prepend("<?php echo ucfirst($this->get_incrMonth($m+1));?>&nbsp;»")
    	.mouseover(function() {
    		ecd.jq(this).css('cursor', 'pointer')
    		})
    	.live('click', function() {
    		ecd.jq('#EC_ajaxLoader').show('slow');
    		ecd.jq.get("<?php bloginfo('siteurl');?>/index.php",
    			{EC_action: "switchMonthLarge", EC_month: "<?php echo $m+1;?>", EC_year: "<?php echo $y;?>"},
    			function(ecdata) {
    				ecd.jq('#EC_ajaxLoader').hide('slow');
    				ecd.jq('#calendar_wrapLarge').empty().append( ecdata );
    			});
    		});

    You will see that the append() function is changed from append(ecd.jq(ecdata).html()) to append( ecdata ) in both the functions and I changed the .click function to use the .live function.

    The above code starts around line 440 in ec_js.class.php.

    As mentioned above, these fixes work for the LargeCalendar, but I have not tested the widget or events list.

  12. austind
    Member
    Posted 3 years ago #

    I can confirm that byronrode's patch does work for the sidebar events list on my 3.0 website. WP did give a non-fatal error when activating the modified plugin, but everything seems to work OK for now. Thanks a lot byronrode!

  13. sipozzz
    Member
    Posted 3 years ago #

    Hello people, took a lot to get to this problem with in-calendar events, the
    wp update me Fatal error appeared in the wp-admin, after searching on
    internet plugins start to see that they had problems, and come to this plugin.
    I can do to return to ride this?

    Please I am not very expert in configuration, but telling me learn the steps

  14. clrader
    Member
    Posted 3 years ago #

    byronrode thanks for all your help. I'm still having issues with the forward and backward in the large calendar display. Next month and last month work fine in the admin but on the site they get a NO COMMENTS page. I also get this error when activating the plug-in

    "The plugin generated 274 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."

    Any ideas? Thanks again.
    corey@brassrailfw.com

  15. moli309
    Member
    Posted 3 years ago #

    Byroncode, I'm the FWD /BCK also does not work for me.

  16. byronrode
    Member
    Posted 3 years ago #

    Hey guys - I will have a look tomorrow and see if I can come up with anything and also give a detailed patch fix providing the files that I have. This was commented on as I progressed through each step so it may not be 100% clear.

  17. sipozzz
    Member
    Posted 3 years ago #

    Thanks @byronrode, this is the only plugin I have turned off and there are many events posted here.

  18. moli309
    Member
    Posted 3 years ago #

    Thanks byroncode!

  19. BushwackCA42
    Member
    Posted 3 years ago #

    Byroncode, you are awesome. Thanks for your efforts. Removing that "locale" code got my site back and my calendar works (Except for the prev and next months) I am not using the 6.6 version of EC. I'm still using the 5.2 version so your code lines dont match up.

    IS there any possibility someone will get the next version of events calendar up to par? I love the plug in, and there is so much need for it, but the beta version is HORRIBLE...

  20. darkmatter661
    Member
    Posted 3 years ago #

    Also tried the mods you suggested Byroncode but FWD /BCK buttons don't appear and event info popup shows code in lieu of event details. CSS seems to be messed up as well.

    Hope to see a revised version real soon!

    Thanks.

  21. byronrode
    Member
    Posted 3 years ago #

    Hey guys,

    As far as I know the developers are almost ready to release version 7 of the plugin.
    Guys, I cannot see what might have gone wrong with the fwd/bck buttons. They are controlled by the JS, so if they are not being inserted correctly then the JS that I have pasted above is not being handled correctly.

    my email is byron (at) byronrode.co.za - please mail me your individual links and I will have a quick look.

    I will also package my custom files that I edited, which you can replace. However I can only guarantee that this would work with the 6.6 beta version.

    Thanks,
    Byron

  22. SamBarker
    Member
    Posted 3 years ago #

    hi byron

    Having the exact problem and need a solution a.s.a.p for a non-profit organisation website.

    any chance i could jump in on that custom file package?

    Keep up the good work champion

    Sam

  23. byronrode
    Member
    Posted 3 years ago #

    Hi Sam,

    Just drop me an email (email is above) and I will send you the plugin files, but bear in mind I just came across another error which is causing custom shortcodes not to load on the page that is requesting the calendar.

    I am trying to find a workaround to it now.

    Cheers,
    Byron

  24. VermilionDL
    Member
    Posted 3 years ago #

    Dropping a note in here to let you know how many of us are watching this one. Upgrading to 3.0 and having the entire site crash hard was definitely heart stopping. Thank god for backups. Appreciate all your work! We'll be watching for an updated package.

  25. jimmycrackedcorn
    Member
    Posted 3 years ago #

    I'm also replying to hopefully add a sense of urgency to this topic. I applied all the changes listed above, and the calendar is sort of working, but (at least in Mac Firefox) clicking forward and back through the months in the large calendar seems to send the Ajax into a loop and it starts changing back and forth through several months before settling on one and stopping.

  26. VermilionDL
    Member
    Posted 3 years ago #

    Yeah, I'm rolling back to my backup. I'll wait for an updated calendar package before I go to 3.0.

  27. dicks
    Member
    Posted 3 years ago #

    I downloaded ec_js.class.php and events-calendar.php from the repository linked here and uploaded them to the server. Since then all is well for the moment.

    The same I did on another site pre-3.0 update and the update went w/o a problem.

    Lets hope a patch or new version comes soon. Kudos to all the contributors here!

  28. BushwackCA42
    Member
    Posted 3 years ago #

    Byron you have been a lifesaver bro. Thanks.

    I haven't upgraded Event Calendar to 6.6 yet, seems that there are a lot of issues with it and I really don't want to go through re-entering all the events I had in it.

    I'll be watching this thread very close for updates, and again thanks to ALL who are working on this. This particular plugin is one of the best ever developed and it's a shame it's having issues.

  29. byronrode
    Member
    Posted 3 years ago #

    Hey guys.

    I am currently working on a patch, which I will send through to the original developer as well as working on some additional changes for the upcoming release.

    I am going to be putting the patched version together for 6.6 online and will get those changes into 7.0 as well.

    My current version has the Tooltips removed as it was something I did not want, but I have rolled back and am adding a switch to the menu, to allow them to be turned on or off.

    Thanks,
    Byron

  30. BushwackCA42
    Member
    Posted 3 years ago #

    Hey Byron, right on. Any idea of how long it will take to get those online? not rushing ya or anything, just trying to keep customers happy...

Topic Closed

This topic has been closed to new replies.

About this Topic