Form Data Does Not Reload on Submit Error

cokenour

New Member
My form data does not persist upon reload following a submission error.

Does Fabrik provide this functionality? If so, how do I enable it?

If not, what is the best work around?
Thanks! The more I use the forms the more benefit I'm getting from them.

Cokenour
 
It should just work the way you expect.

What version are you using? If you don't have the latest SVN, suggest you upgrade and see if that fixes it. See my sig for SVN info.

-- hugh
 
I'm on 1.0.3.
I downloaded/installed/updated the SVN based on the instructions.
I started receiving this error on all pages with Fabrik forms:

Fatal error: Call to undefined function addheadtag() in [my site directory]/components/com_fabrik/fabrik.html.php on line 1461

So I set it back, then downloaded the patch to 1.0.6. There was no readme file included, and since the Joomla installer didn't work, I extracted the zip and uploaded the files manually.

The forms display fine, but now I cannot access the Fabrik backend. When I go to any of the component menu items I get this error:

Fatal error: Call to undefined function addheadtag() in [my site directory]/administrator/components/com_fabrik/admin.fabrik.html.php on line 29

Thoughts?
 
also double check that you have uploaded correctly this file:

components/com_fabrik/fabrik_functions.php

sometimes ftp doesnt actually upload the file correctly :)
 
I reloaded the components/com_fabrik/fabrik_functions.php file for good measure, but still the same results.

The site is on Joomla 1.0.x. It's an undergraduate college site, here are the URL's to the forms I'm using:

Form 1
Form 2
Form 3


 
Yes, but which 1.0.x? It's the 'x' I need to know. I'm not sure when J! added the addHeadTag() function.

-- hugh
 
Can you check your fabrik_functions.php file on the server, and make sure it has the addHeadTag() function defined, around line 239.

-- hugh
 
No, it doesn't. It's only 163 lines too. Here's the code:

PHP:
<?php

/* MOS Intruder Alerts */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/*
 * shared functions between the admin and front end
 */

/**
  * switches the database depending on the table connection or fabrik id
  * @param object table
  * @param object connection
  * @return array (database object, table name);
  */
  
 function switchDatabase($oTable, $oConn){
    global $database;
     if( $oTable->connection_id != '-1'){
         $fabrikDb = $oConn->loadTableConnectionDB( );
         $table = $oTable->db_table_name;
     }else{
         $fabrikDb = $database;
         $table = "#__fabrik_formdata_" . $oTable->form_id;
     }
     return array($fabrikDb, $table);
 }


 /**
  * makes the table navigation html to traverse the table data
  * @param int the total number of records in the table
  * @param int number of records to show per page
  * @param int which record number to start at
  */
 global $mosConfig_absolute_path;
 require_once( $mosConfig_absolute_path . '/administrator/includes/pageNavigation.php' );

 /**
  * extension to the normal pagenav functions
  * @paraM int total
  * @param int limitstart
  * @param int limit
  */
 class fabrikPageNav extends mosPageNav{

     var $_formName = 'fabrikTable';

     function getPagesLinks() {
         $html                 = '';
         $displayed_pages     = 10;
         $total_pages         = ceil( $this->total / $this->limit );
         $this_page             = ceil( ($this->limitstart+1) / $this->limit );
         $start_loop         = (floor(($this_page-1)/$displayed_pages))*$displayed_pages+1;
         if ($start_loop + $displayed_pages - 1 < $total_pages) {
             $stop_loop = $start_loop + $displayed_pages - 1;
         } else {
             $stop_loop = $total_pages;
         }

         if ($this_page > 1) {
             $page = ($this_page - 2) * $this->limit;
             $html .= "\n<a href=\"#beg\" class=\"pagenav\" title=\"first page\" onclick=\"javascript:fabrikNav(0);return false;\">&lt;&lt;&nbsp;Start</a>";
             $html .= "\n<a href=\"#prev\" class=\"pagenav\" title=\"previous page\" onclick=\"javascript:fabrikNav($page);return false;\">&lt;&nbsp;Previous</a>";
         } else {
             $html .= "\n<span class=\"pagenav\">&lt;&lt;&nbsp;Start</span>";
             $html .= "\n<span class=\"pagenav\">&lt;&nbsp;Previous</span>";
         }

         for ($i=$start_loop; $i <= $stop_loop; $i++) {
             $page = ($i - 1) * $this->limit;
             if ($i == $this_page) {
                 $html .= "\n<span class=\"pagenav\"> $i </span>";
             } else {
                 $html .= "\n<a href=\"#$i\" class=\"pagenav\" onclick=\"javascript:fabrikNav($page);return false;\"><strong>$i</strong></a>";
             }
         }

         if ($this_page < $total_pages) {
             $page = $this_page * $this->limit;
             $end_page = ($total_pages-1) * $this->limit;
             $html .= "\n<a href=\"#next\" class=\"pagenav\" title=\"next page\" onclick=\"javascript: fabrikNav($page);;return false;\"> Next&nbsp;&gt;</a>";
             $html .= "\n<a href=\"#end\" class=\"pagenav\" title=\"end page\" onclick=\"javascript: fabrikNav($end_page);return false;\"> End&nbsp;&gt;&gt;</a>";
         } else {
             $html .= "\n<span class=\"pagenav\">Next&nbsp;&gt;</span>";
             $html .= "\n<span class=\"pagenav\">End&nbsp;&gt;&gt;</span>";
         }
         return $html;
     }

     /**
      * @return string The html for the limit # input box
      */
     function getLimitBox () {
         $limits = array();
         for ($i=5; $i <= 30; $i+=5) {
             $limits[] = mosHTML::makeOption( "$i" );
         }
         $limits[] = mosHTML::makeOption( "50" );

         // build the html select list
         $html = mosHTML::selectList( $limits, 'limit', 'class="inputbox" size="1" onchange="fabrikNavLimit(this.options[this.selectedIndex].value);"',
        'value', 'text', $this->limit );
        $html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"$this->limitstart\" />";
        return $html;
    }
}
    
/**
 * maintains the session array that contains the state for the table's ordering
 * @param string the current column to order on
 * @param string the direction in which to order the current ordering column
 */
 
function updateOrderSession($orderBy, $orderDir){
    if(!isset($_SESSION['aOrder'])){
        $_SESSION['aOrder'] = array();
    }
    if($orderBy != ''){
        $_SESSION['aOrder'][$orderBy] = $orderDir;
    }
}

 /** returns all elements in $all which are not in $used in O(n log n) time.
  * elements from $all are prefixed with $prefix_all.
  * elements from $used are prefixed with $prefix_used.
  */
  
 function filter_unused( $all, $used, $prefix_all = "", $prefix_used = "" ) {
     $unused = array();
     /* prefixes are not needed for sorting */
     sort( $all );
     sort( $used );
     $a = 0;
     $u = 0;
     $maxa = sizeof($all)-1;
     $maxu = sizeof($used)-1;
     while( true ) {
        if( $a > $maxa ) {
            break;
        }
        if( $u > $maxu ) {
            /* rest of $all is unused */
            for( ; $a <= $maxa; $a++ ) {
                $unused[] = $all[$a];
            }
            break;
        }
        if( $prefix_all.$all[$a] > $prefix_used.$used[$u] ) {
            $u++;
            continue;
        }    
        if( $prefix_all.$all[$a] == $prefix_used.$used[$u] ) {
            $a++;
            $u++;
            continue;
        }
        $unused[] = $all[$a];
        $a++;
    }
    return $unused;
}
?>
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top