Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simultaneous editing and creating of entries in events with "Allow Multiple" not working #749

Closed
klaftertief opened this issue Aug 27, 2011 · 3 comments

Comments

@klaftertief
Copy link
Contributor

In section events with the Allow Multiple option set you can't simultaneously create and edit entries. This is because every new entry gets the id of previous existing entries passed, so you are editing an existing entry with the post values from a new entry. This is because in line 421 of event.section.php

if (isset($post['id'][$position]) && is_numeric($post['id'][$position])) {
    $entry_id = $post['id'][$position];
}

$entry_id doesn't get reset when $post['id'][$position] is not set (for new entries). I think that just appending

else {
    $entry_id = NULL;
}

to those lines solves this issue.

@brendo
Copy link
Member

brendo commented Aug 28, 2011

Neat, I didn't even think that this would be possible, but the logic is abstracted enough that it is. Woohoo!

@brendo brendo closed this as completed in e32a53c Aug 28, 2011
@klaftertief
Copy link
Contributor Author

I assumed it should work, but it didn't. Glad it was easy anough to fix :-)

Thanks for applying the fix. Just wanted to add that I haven't tested it heavily. So you don't expect any side-effects?

@brendo
Copy link
Member

brendo commented Aug 29, 2011

No, the logic appears abstracted so that it's as if you were executing '3' events, so I don't think it matters that it swaps between editing and creating new.

I can't say I've given it a through test though, so feel free to Reopen if you find any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants