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

[WIP] Feature/prevent session override #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Firesphere
Copy link
Owner

Needs tests

$existing = PartialFormSubmission::get()->byID((int)$id);
if ($existing) {
// Check if it has started yet, we need to start a new one, if it has started
$startNew = $existing->isStarted();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the partial form has started (like if there's a partial form in a different tab), then it will create a new one?

What do we do with cases like, in one tab you have partial page, in another tab is a new one? How do we manage the sessions?

}

if ($startNew) {
$partialForm = PartialFormSubmission::create()->write();
Copy link
Collaborator

@lhalaa lhalaa Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this to onAfterInit() so you can assign a Parent and UserDefinedForm from $this->owner->getData() when creating a new PartialFormSubmission. This will create another AccordionItems

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

Successfully merging this pull request may close these issues.

2 participants