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

FiX: some survey texts can not be cleared out #780

Closed
wants to merge 3 commits into from

Conversation

TonisOrmisson
Copy link
Collaborator

I wanted to clear out survey end-url and it was not possible. Also the basic text blocks should be able to be cleared out.

@lacrioque
Copy link
Contributor

The check for empty are absolutely necessary, because otherwise an empty post would always change the survey setting to empty.
So we either need to find a better way to edit surveys, or this needs to stay in place.
Have you tested this?

@Shnoulle
Copy link
Collaborator

Shnoulle commented Oct 9, 2017

Need !is_null ? Yii::app()->request->getPost('description_'.$langname); return null, BUT we fixCKeditor after …

@TonisOrmisson
Copy link
Collaborator Author

TonisOrmisson commented Oct 9, 2017

The model validation should be done by Model->rules()

Currently - one can create a new survey with an empty description (and welcometext etc.), but one can not clear out the existing text if the text already exists. Which is not consistent logic.

If the idea is that Survey must always have a welcometext then it should be set by the model rules.

Also, the Empty post validation should be solved by using the Survey->save() method rather than any custom things. Also - in this PR it still checks for the title not to be empty so an "empty post" will not pass here. And if I have an empty welcometext, then this is what i want :)

@TonisOrmisson
Copy link
Collaborator Author

In a sense this was a quick fix for a problem that just faced me while I wanted to clear some texts. But in longer run the survey->save() and model rules is what should be worked on :)

@TonisOrmisson
Copy link
Collaborator Author

Just retested it, works

@lacrioque
Copy link
Contributor

lacrioque commented Oct 9, 2017

OK.
Yes I'm with you it should be done in Survey->save().
We just lack the time to transfer the logic to the surveymodel, since we do only bugfixing for 3.0

Have you tested peripheral posting? Try posting any setting from somewhere and have a look on the values.

Better to use the yii->request->getPost() with null as standardvalue and check against null as shnoulle supposed.

@TonisOrmisson
Copy link
Collaborator Author

No didn't test peripheral posting.

Why only bugfixes for 3.0? Where the develop should go then? :)

And to be frank, this specific PR is a bug fix. There is different validation on creating and updating a model.

I'll work a bit on trying to use the yii way

@LouisGac
Copy link
Contributor

LouisGac commented Oct 9, 2017

Don't worry Tony, you can continue to submit your great PR

@c-schmitz c-schmitz changed the base branch from develop to master December 20, 2017 22:47
@TonisOrmisson TonisOrmisson deleted the findfix7 branch April 24, 2018 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants