Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    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.

    Thread Starter jwk

    (@jwk)

    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.

    Plugin Author Stephen Harris

    (@stephenharris)

    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!

    Thread Starter jwk

    (@jwk)

    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!)

    Plugin Author Stephen Harris

    (@stephenharris)

    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.

    Thread Starter jwk

    (@jwk)

    Works great! Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Wrong default in `input` element’ is closed to new replies.