WordPress.org

Ready to get started?Download WordPress

Forums

Event Organiser
Wrong default in `input` element (7 posts)

  1. jwk
    Member
    Posted 1 year ago #

    Line 65 of event-organiser/event-organiser-edit.php has <input type="checkbox" id="HWSEvent_rec" name="eo_input[AlterRe]" value="yes">. Instead of value="yes" you should have checked.

    http://wordpress.org/extend/plugins/event-organiser/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi jwk, that's the value of the checkbox, not whether it is checked or not. That checkbox is used whenever you want to edit the event dates (this prevents the plug-in from recalculating and resaving event dates unnecessarily). It only appears for recurring events, and shouldn't be checked by default.

  3. jwk
    Member
    Posted 1 year ago #

    Thanks, Stephen. That makes sense.

    Is there any way that I can set this box checked/unchecked programmatically? It would be a big help for my plugin that interacts with yours--my users aren't going to think of checking that box before hitting Publish, and then EO thinks the start date hasn't been set and gives an error.

  4. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    mmm... It shouldn't give an error...

    It shouldn't appear for new events, and or non-recurring ones. If unchecked, the post should be updated - but not the dates. If you're getting an error message that's a bug - can you let me know the steps to reproduce?

    Thanks!

  5. jwk
    Member
    Posted 1 year ago #

    In this case the event is new but recurring from its inception--probably not a combination you foresaw. To reproduce the error, paste into your functions.php the following code:


    add_action( 'init', 'add_parev_filter' );

    function add_parev_filter() {
    add_filter('eventorganiser_get_event_schedule', 'parev_meta_xfer', 10, 2);
    }

    Follow this code with the parev_meta_xfer function here, but change this line
    $dow_array = convert2eoDays( explode(',',$_GET['dow']) );
    to this
    $dow_array = explode(',',$_GET['dow']);.

    From an administrative screen paste this into the URL box:

    http://yourwpsiteurl.com/wp-admin/post-new.php?post_type=event&post_title=Bible%20Study&content=We%20meet%20in%20the%20conference%20room.&excerpt=We%20meet%20in%20the%20conference%20room.&post_cat=meeting&schedule=weekly&dow=MO&start=18:30&end=20:00

    This will bring up the New Event screen with the Event Details fields pre-populated. Now press Publish and in the reloaded screen, the error will appear:

    Event dates were not saved.
    Start date not provided.

    The Event Details will have been cleared too.

    (I hope this shows okay. It'd be nice to have a preview available before posting!)

  6. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Ah ok, the plugin assumes 'new' events will not have their schedule as recurring - hence the checkbox appearing...

    And because if the user doesn't uncheck the box, no event data is sent - giving the error.

    Best bet would be to edit this line so it becomes

    $sche_once = ( $schedule == 'once' || !empty(get_current_screen()->action) );

    should work. Let me know and I'll fix it in the next release.

  7. jwk
    Member
    Posted 1 year ago #

    Works great! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic