Dear Theodoros,

In data lunedì 22 ottobre 2012 18:15:47, Theodoros Theodoropoulos ha scritto:
> When submitting using the web forms and only if a document has more than
> 1 page, when you navigate from one page to another:
> 
> If an element already has a value[*] in pg1 and you edit it, then go to
> pg2, everything is OK :)
> If an element already has a value[*] in pg1 and you DELETE THE VALUE
> COMPLETELY, then go to pg2, and then BACK to pg1, you see the old value!
> This means that the FILE in the disk that corresponds to this element is
> NOT updated IF the new value is "" (although the system checks of the
> page see the 'new', empty value).
> 
> This results in users not being able to 'empty' old values when moving
> from one page to another. One can only change them into something else!
> 
> I can verify that it appears in a snapshot of master branch taken from
> git 3 weeks ago, but i believe it appears in earlier/later releases. Can
> you verify it? If yes, I think it's a bit important and needs fixing...
> 
> [*] either by continuing a previously-incomplete submission, or by
> entering a value, going to another page and then back

Indeed WebSubmit is not enough robust in supporting moving back and forth 
submission form. However your report is well detailed to allow for a possible 
solution.

I suspect we should introduce some support for the above somewhere in 
websubmit_engine.py in the interface function near:

[...]
    # we parse all the form variables
    for key, formfields in form.items():
        filename = key.replace("[]", "")
        file_to_open = os.path.join(curdir, filename)
        try:
            assert(file_to_open == os.path.abspath(file_to_open))
        except AssertionError:
            register_exception(req=req, prefix='curdir="%s", filename="%s"' % 
(curdir, filename))
            return warning_page(_("Invalid parameters"), req, ln)

        # Do not write reserved filenames to disk
        if filename in CFG_RESERVED_SUBMISSION_FILENAMES:
            # Unless there is really an element with that name on this
            # page or previous one (either visited, or declared to be
            # visited), which means that admin authorized it.
            if not ((str(curpage).isdigit() and \
                    filename in [submission_field[3] for submission_field in \
                                 get_form_fields_on_submission_page(subname, 
curpage)]) or \
                    (str(curpage).isdigit() and int(curpage) > 1 and \
                    filename in [submission_field[3] for submission_field in \
                                 get_form_fields_on_submission_page(subname, 
int(curpage) - 1)]) or \
                    (previous_page_from_disk.isdigit() and \
                     filename in [submission_field[3] for submission_field in 
\
                                  get_form_fields_on_submission_page(subname, 
int(previous_page_from_disk))])):
                # Still this will filter out reserved field names that
                # might have been called by functions such as
                # Create_Modify_Interface function in MBI step, or
                # dynamic fields in response elements, but that is
                # unlikely to be a problem.
                continue
[...]

I'll ticketize it and we should be hopefully able to find a solution :-)

Cheers!
        Sam

-- 
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>

Reply via email to