Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1259

Make "FormManager" use form's "action" attribute, when "url" not set when configuring that form

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.1-RC1
    • Component/s: Front End
    • Labels:
      None
    • Change Log Group:
      Changed
    • Change Log Message:
      When AJAX-validated form submit URL wasn't specified during form configuration use form's "action" attribute as fallback.
    • Story Points:
      1
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      FormManager is a JavaScript class, that is used by In-Portal be able to perform real-time form data validation and submission.

      Right now it takes form data and sends it (along with OnCreateAjax or similar event) to homepage. Fact, that form data is sent to homepage instead of current page (where form was submitted) might seem strange, but it doesn't really change much because event, which would do data processing doesn't care about url from where it was submitted.

      Recently I stumbled upon problem, that forces me to reconsider url to which form is being submitted via AJAX. The unit I was writing wasn't able to complete it's task without several other units being present on page url as well. Since the url where submission was made wasn't having these units, then as a result event ended up with a Fatal Error.

      After a bit of coding I ended up with following submission url detection scheme:

      1. use url, specified during form configuration (via FormManager::registerForm´╗┐ method)
      2. if missing, then use url from action´╗┐ attribute of form, that will be submitted
      3. if missing, then use homepage url as before

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
                Reviewer:
                Dmitry Andrejev [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: