1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.
    Dismiss Notice

handling form plugin from form in modal window

Discussion in 'Professional Support' started by skyrun, Jul 29, 2018.

  1. skyrun

    skyrun Active Member

    Level: Professional
    on a list, i have a button (add using template) that loads a fabrik form in a modal box:

    View attachment 17423
    you can see the url above if you have access to testlocation.skyrun.com/skytrax.

    working great so far...

    when i press 'create' i use a php form plugin that copies the template into a new row which of course know the id of. (this works too).

    but then i would like for that row to open up on the main browser window in place of the modal and prior page (ie, be redirected to: skytrax-manage/work-orders/form/180/[new_id_here]).

    but i can't seem to figure out how to make the form in the modal redirect.

    here what i have tried in the php form plugin onAfterProcess:
    • PHP:
        echo "<script>window.location = 'skytrax-manage/work-orders/form/180/".$newwoid."';</script>";
        exit;
      this gives a json error: SyntaxError: Unexpected token < in JSON at position 0 . this is because the form, when run in a modal window, is expecting JSON to be output by the form.... so i tried to create some for it and tried this:

    • PHP:
      echo '{"msg":"Work Order Created from Template {add_work_order_using_template___template}","url":"skytrax-manage\/work-orders\/form\/180\/'.$newwoid.'","baseRedirect":true,"rowid":"'.$newwoid.'","suppressMsg":false}';
      exit;
      this shows the screen below with the message, but doesn't redirect after i press 'ok'. it removes the modal, but is on the same list as when i launched the modal.
    View attachment 17425

    what would i need to do in order to redirect to skytrax-manage/work-orders/form/180/[new_id_here]. is there a 'redirectURL' parameter (or documentation on what parameters there are?)
     
    Last edited: Jul 31, 2018
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Trying to open that page, but I'm getting:

    Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php70) in /xxx/xxx/test/libraries/joomla/session/session.php on line 830
     
  3. skyrun

    skyrun Active Member

    Level: Professional
    i'm not getting that of course.
    you have to be logged on, are you logging on using the 'hugh' userid?
     
  4. skyrun

    skyrun Active Member

    Level: Professional
    bump.
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'm back from vacation.

    I can now login, but having problems finding the page. if I try the URL from your first image (/new-work-order) I get a 404. If I use the "Work Order V2" menu link, I get a list with that "Create from template" button, but it opens in a new tab, not a popup.

    -- hugh
     

Share This Page