WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Recurring Events and ACF

[Resolved] Recurring Events and ACF

Viewing 15 replies - 1 through 15 (of 20 total)
  • Hello,

    Can you tell more about what behaviour you expect ?

    I had a look and it seems to work as I expected.
    If you define a custom field for event you will find it when editing the event.
    If you define a custom field for a recurring event, you will find it when editing the recurring event but not when you edit the instances of this recurring event. Instead (on the instance) you will see the custom field you defined for event.

    In other words, EM does not propagate recurring event custom fields when creating the instances.

    Does it make sense ?

    thank you. yes, i want to setup custom fields in a recurring event. so events of this recurring term will have the same configuration. but it doesnt work..is there a solution? i do not want to setup the several event..

    angelo_nwl

    @angelo_nwl

    NetWebLogic Support

    sorry, can’t give you an advice with regards to integrating the two plugins since I haven’t tried it yet.

    Plugin Author Marcus

    @netweblogic

    hard to say without diggging into the way ACF is saving custom fields, but EM should replicate all the custom post fields belonging to an event.

    @franceimage:

    In other words, EM does not propagate recurring event custom fields when creating the instances.

    Ok, i understand. both types are several things.
    with thumbnails i have the same problem.
    but is it possible to transform custom fields of recurring event to cf of several event? maybe the same way for thumbnails?

    Hello,

    I searched a bit more and I found out I overlooked the problem.

    In em-event.php (save_events()) there is code to propagate the postmeta.
    However, EM creates the events while saving the recurring event.
    This means that the recurring event (ACF) postmeta are not yet saved when EM creates the events (instances of the recurring event).

    I noticed that if you save the recurring event 3 times, you end up seeing your custom field in the events (provided you have configured ACF to handle it in event OR recurring-event posttype).

    BUT, if you do that, you have 3 times more events than you want.

    A bit tricky 🙁

    Hello,

    I searched a bit more and I found out I overlooked the problem.

    In em-event.php (save_events()) there is code to propagate the postmeta.
    However, EM creates the events while saving the recurring event.
    This means that the recurring event (ACF) postmeta are not yet saved when EM creates the events (instances of the recurring event).

    I noticed that if you save the recurring event 3 times, you end up seeing your custom field in the events (provided you have configured ACF to handle it in event OR recurring-event posttype).

    BUT, if you do that, you have 3 times more events than you want.

    A bit tricky 🙁

    The full snippet around that appears to suggest that it will only save if the recurring events has been published:

    if( $this->is_recurring() && $result && $this->is_published() ){ //only save events if recurring event validates and is published
    			 	if( !$this->save_events() ){ //only save if post is 'published'
    					$this->add_error(__ ( 'Something went wrong with the recurrence update...', 'dbem' ). __ ( 'There was a problem saving the recurring events.', 'dbem' ));
    			 	}
    			}

    I will have to defer to Marcus on this but that code suggests that isn’t the issue in this particular case.

    Cheers

    workaround (it works for me)

    add recurring event -> edit -> save
    edit single event(child of this recurring e.) -> edit CF -> save

    running..

    hm, but old entries still not showing cf

    ok, i ask for a second: is it possible to transform custom fields of recurring events to custom fields of several event?

    Plugin Author Marcus

    @netweblogic

    custom fields should be copied over to recurrences, however, the ACF hooking in later presents a problem, something we might not tackle since our future plans to rewrite recurrences wold fix this automatically.

    sorry marcus, i didnt understand your answer. in future it will be possible or not?

    It should be yes, although it won’t be fixed directly. Rather, some other improvements to the way the plugin works will render this issue obsolete.

    No ETA on when that will happen though I’m afraid.

    Thanks

    ACF uses simple custom fields – i cannot understand, why it doesnt work for recurrences.
    so it makes more complicated for me, to use EM. i will try it with attributes. But in my opinion, attributes are also custom fields. am i right?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Resolved] Recurring Events and ACF’ is closed to new replies.