Hi everyone,
I tried to edit a field(say some text field or body field) and choose "Update all following" or "Update all dates in the series", without changing the value of the repeat event date field, the value of the filed(say some text field or body field) is updated only in the current repeat event node and not in all other nodes.
On analysis, I came to know that, when the date of the repeat event is not changed, only the title of the events can be updated using "Update all following" or "Update all dates in the series" but not the other fields.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | date_repeat_entity-2447949-18-update_fields.patch | 4.62 KB | Anonymous (not verified) |
Comments
Comment #1
paulraj augustin commentedComment #2
paulraj augustin commentedI am uploading a patch for this issue. Kindly review the patch.
Comment #3
paulraj augustin commentedSorry, wrong patch name. I am uploading another patch.
Comment #4
shortspoken commentedThank you @a_paulraj. As far as I can tell the patch works as advertised! :)
Comment #5
merilainen commentedUpdated status
Comment #6
merilainen commentedThere is also this mentioned in the README.txt file:
"A separate HOOK_repeating_date_update is provided to enable other
module developers to determine which properties and fields of each entity
should be updated."
So perhaps that is the recommended way to achieve this. Although blindly copying all fields sounds easier for site-builders, but there might be some fields which should never be copied.
Also, I'm not familiar with the module functionality, but how does the patch behave when user changes one value in one event in the series, let's say price for one specific day, then anther update comes which changes the event image for all events in the series. Is the price value also overwritten which should be different for that one event?
Comment #7
merilainen commentedHere is a quick example of how to implement the same thing the patch does in a custom module using the hook I mentioned:
This method also makes it possible to skip any additional fields, add more custom logic per fields etc.
Comment #8
geek-merlinThis should in fact be configurable.
Comment #9
geek-merlinPatch flying in that fixes this.
It adds a submodule that lets sitebuilders configure which properties to copy.
Using it here in production.
Comment #10
kopeboy#9 Tested.
It clones field when creating, but doesn't update them after editing one node of the series.
Update: oh wait, it does, but only if you change the date field.
And the checkboxes' status at admin/config/date/date_repeat_entity of the fields to replicate are not saved.
Comment #11
tusharbodke commentedHI Axel.rutz,
Patch looks fine to me, except change in one line as follow.
Existing line to assign property to all repeated dates.
$date_entity_wrapper->$property_name = $updated_entity_wrapper->$property_name;Above line should be like
$date_entity_wrapper->$property_name = $updated_entity_wrapper->$property_name->value();Please have a look, everything else work fine for me.
Thanks
Comment #12
Steve Polito Design commentedThanks for all the hard work on this! I have patched the module using the patch from #9, but am running into the following error when attempting to update all events in a series.
EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityMetadataWrapper->set() (line 122 of /sites/all/modules/entity/includes/entity.wrapper.inc).I noticed that this error was mention in this related issue.
Comment #13
tusharbodke commentedHi Steve Polito Design,
Please refer comment #11, to resolve your problem.
Its suggested to update #9 patch at single place, and it will work as expected.
Thanks
Comment #14
jwineichen commented#9 submodule with the #11 edit works for me
Comment #15
yorkshire-pudding commented#9 patch with the #11 edit works for me. @axel.rutz - any chance of updating the patch so this can be progressed?
Thanks
Comment #16
socialnicheguru commentedcan patch in #9 be re-rolled with #14 update?
Also do you have to select all the fields for them to be considered?
Or is the default that all of these fields will be replicated?
If I select a field, then it will be automatically copied to all the instances and I will not be asked to update all?
Is #10 still an issue?
Comment #17
socialnicheguru commentedIt doesn't check if you have actually repeated the date.
it puts up a confirmation message 'Confirm Update' anyway.
Comment #18
Anonymous (not verified) commentedHere's axel.rutz's patch from #9 with tusharbodke's fix from #11 added.
Comment #19
botrisComment #20
roxart commentededit, sorry worked now - my mistake