I have EventRepeat successfully installed. I have successfully created a repeating event. I would like to attach the same doc (eg, Event details) to each occurrence. When I attach to the first Event, the attachment only appears with that first occurrence. Is there a way to make it attach to all?
Thanks.

CommentFileSizeAuthor
#2 eventrepeat_files.patch1.11 KBseanbfuller

Comments

seanbfuller’s picture

Thanks for the bug report. I believe this was working in 4.7, but is not working in 5. I'll take a look as soon as I can.

seanbfuller’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

Sorry this took so long, but it took me a few attempts at tracing the workflow to track this down.

I spent some time digging into this. It appears that it has to do with the way the file id and the node id are being related. All the nodes end up with the same file id. As a result, the upload module won't create the subsequent entries in the file database.

Usually in relationships like these, each node will end up with a new id for the nodeapi module, but upload flips the $node->files[$key]->fid value from the key (eg "upload_0") to the next db sequence to note that the file association has already been processed. When copying the original node on sequence creation, however, all the fids end up with the db sequence of the first and the insert never happens.

This patch puts a small check in _eventrepeat_render_nodes that flips all the nodes back to the $key so that they will update.

seanbfuller’s picture

Status: Needs review » Fixed

Committed to both 5.x-1.x and 5.x-2.x

Anonymous’s picture

Status: Fixed » Closed (fixed)