Bug #27912
Not all the fields are kept when an input error happend when creating a news in FE OR Editing existing news in FE
| Status: | Under Review | Start date: | 2011-07-06 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | 2011-08-17 | |
| Assignee: | André Steiling | % Done: | 100% |
|
| Category: | Frontend Plugin | |||
| Target version: | 1.1 | |||
| TYPO3 Version: | 4.5 | Has patch: | No | |
| PHP Version: | 5.3 | |||
| Votes: | 0 |
Description
When a input error happen in FE (i.e forgotten mandatory field, the page is reloaded with the message "Input error!"
Or When a FE user try to edit one of his news
Some fields, like "category" "file" "Archive date", etc are reseted, when the value of fields "title", "subtitle" "links" is kept
Related issues
| related to Frontend News - Bug #27824: Archive date : the field is a simple text field in the la... | Closed | 2011-07-04 | 2011-07-08 |
History
Updated by André Steiling almost 2 years ago
- Category set to Frontend Plugin
- Status changed from New to Accepted
- Assignee set to André Steiling
- Target version set to 1.1
Yes, it's identically to issue #27824 - I have to check the validation process, something went wrong dramatically!
Updated by André Steiling almost 2 years ago
- Status changed from Accepted to Needs Feedback
Hi Laurent,
I coudn't reproduce what have descriped:
The plugin is set up to render ALL fields, so I create a new news and leave the mandatory field "title" untoched, while all other fields are filled out correctly. The forms loads again and throws the error message and all my values are there again!
All fields? Not all, ok ... there is still a little restriction: The validation and saving routine is not yet finished in case of the new selection fields "Related news", "Language" and "FE Group", so theese fields will reset their values when an error message appears or simple by opening a record.
The upload fields are not manipulable, they are handled by the browser itself (security reason) and the is no way to hold the value, so the user has always to readd his image / file when an error occures. Maybe the whole server-side validation process could be done by JavaScript / AJAX in the future - this would be a modern way to validate the user's input.
Updated by PAM almost 2 years ago
Hi André,
Back again, after a little break ;-) : it was really necessary!
I've been testing the last SVN version:
When :
- a input error happen in FE (i.e forgotten mandatory field or bad format) and the page is reloaded with the message "Input error!"
- When a FE user edit one of his news
- Archive date
The archive date is now OK, it is well kept. WELL DONE !
- Categories :
Unfortunately categories are still reseted after input error or edition
- Upload fields :
You said "The upload fields are not manipulable, they are handled by the browser itself (security reason) and the is no way to hold the value, so the user has always to readd his image / file when an error occures. Maybe the whole server-side validation process could be done by JavaScript / AJAX in the future - this would be a modern way to validate the user's input."
I understand it for new news submission, but I was thinking something can be done for edition of existing news, as on the edit form the actual file path is displayed (Current file: filepath)
If the FEUSER do not reselect the file on is computer, it leads to "Input error!"
It's could be unconvenient for FEuser as they may have delete or lost the original attached files...
Greetings,
Laurent
Updated by André Steiling almost 2 years ago
- Due date set to 2011-08-17
- % Done changed from 0 to 20
Hello Laurent,
I can't reproduce your descriped errors! I use the newst version in SVN.
1. Categories work as well as every other field, no matter if I create a new record or edit one, if I produce an input error or not ... Maybe you have to press the clear all cache button, because I changed a lot of TypoScript.
2. Do you use DAM support? I use it and again, everything works fine ...
Updated by André Steiling almost 2 years ago
- Status changed from Needs Feedback to Under Review
- % Done changed from 20 to 100
Hey Laurent,
I think I've got it! The error occurs on the normal file list and it's fixed - your feature "delete current file" is also integrated. Seems, that I could role out the new version v1.1, if you find no more bugs! Very great job of yourself, many thanks to you for testing my extension in deep!! Today I had a flow, sitting here right at a beer garden ... :D
Updated by PAM almost 2 years ago
I haven' found much time yet to test...but
I have check the last SVN version, and I am afraid Bug #27912 is not totally solved yet . Sorry
I mean, for example (with categories and attached file filed mandatory):
If I create a new news, and I forgot to fill a mandatory field, the page is reloaded with Input error" message,
but the previously selected categories are not kept, as well as attached file.
A related issue is happening when editing a news , previously selected categories are not kept, and attached file is dipslayed but if not reselected give input error.
Greetings,
Laurent
Updated by André Steiling over 1 year ago
Hi Laurent,
I could not reproduce your category problem, in every case the selected ones are keeped! Maybe your TS has changed, do you adopt the TS setup which comes along with the extension?
Upload problem:
Did you setup the file upload as required field? In this case the validation process could be wrong in edit mode ... In case of a new record and an error, the selected file is cleared - there is no way to reselected it, this is what I meant at the beginning: It's handled by the browser and you could not reach the upload field, only the content after submit the form.
Updated by PAM over 1 year ago
Hi André
I could not reproduce your category problem, in every case the selected ones are keeped! Maybe your TS has changed, do you adopt the >>TS setup which comes along with the extension?
You can see it online :
-Go to
URL: http://detra.ifsttar.fr/positions-seeker/dashboard/
-log in
Login/password : testas / steiling
I've been created news (wich are called CV on this site) with your test account
-Go to the page where you news are listed
http://detra.ifsttar.fr/positions-seeker/your-cvs/
-Click on a news title
-Click on the edit icon
You can see that in the edit form categories are not kept.
The file previously selected but is displayed but :
If you just save a this point :
Input error!
Please fill in field Select all the matching categories (ctrl+click).
Please fill in field Select your CV (pdf format only).
I use the TS from the last SVN version
Upload problem: Did you setup the file upload as required field?
Yes In this case the validation process could be wrong in edit mode ...
Is there any way to fix this? I really need the file upload as required field
In case of a new record and an error, the selected file is cleared - there is no way to reselected it, this is what I meant at the >> beginning: It's handled by the browser and you could not reach the upload field, only the content after submit the form.
Ok for this
Have a nice day
Laurent
Updated by André Steiling over 1 year ago
It's very curios ...
It seems that the userFunc doesn't return the array-key "selected" and so your categories are not re-selected in edit mode. Did you really leave the TS config untouched, so the following setup is active:
category {
[...]
# @description Don't touch: Parameter is set directly by the plugin and predicates on the FlexForm category settings
special.userFunc.where = PHP_VALUE
- @description Don't touch: Parameter is set directly by the plugin and holds an array with selected items for edit mode
special.userFunc.selected = PHP_VALUE
[...]
Please edit the userFunc (lib/class.user_selectionMenu.php) at line 113 as follow:
t3lib_div::debug($arrMenu);
Go to the frontend and edit a news: It outputs a T3 debug message, a table with all values of every selection field. Please let me know, what you get ...
Updated by André Steiling over 1 year ago
Hi Laurent,
the validation of the upload fields is solved by the new version in SVN. I had to change the HTML template, so you have to insert the following field into the form:
<input type="hidden" name="###PREFIX_ID###[uid]" value="###VALUE_UID###" />
Updated by PAM over 1 year ago
- File debug__arrMenu_.odt added
- Upload field
I think the upload field is OK
It is possible now to edit a news without having to reselect the file. Cool !
Just a small detail : Even if the upload field is declared as mandatory, a FE user can check « delete file » when editing his news without having error message if he doesn't choose a new file, so the field is not mandatory anymore ;-)
- Editing
I am afraid I have to news issues on editing ( I use the last SVN with no personal TS)
In this version , editing only work on upload field, other fields are not actually modified after editing
When editing a news upload field, it publish without validation (it should be hidden until validation by BE users when this option is set
You still have access on my website if you want to try it
- Selected Categories :
I really use the default TS config, so the TS you mention is active
I put in the attached file what I get when editing with t3lib_div::debug($arrMenu);
Greetings
Laurent