Performance issue with repeat group

procajlok

Member
Hello!
I have a problem with the repeat group performance, and i dont know what field generate the problem.
In every repeat i have 27 field. Among them there are 17 fields with php validation enabled - 14 with 'notempty' 3 with 'notempty' and my php code (above this post).

The problem is when user add circa 17 repeat, the page hangs up, slows down and user cannot add new repeat and go to next page.

My question: Can You check PHP code - maybe this slows down the page?
Can we increase the performance of repeat group?
How will a repeating group behave at 80-100 repetition? - That is possible in my system! :eek::oops:

In attachement i send screens from firefox console. There is something wrong...

There is 1st field PHP code:
PHP:
if (!function_exists('validatepesel'))
{
    function validatepesel($data) {
    $reg = '/^[0-9]{11}$/';
    if(preg_match($reg, $data)==false)
        return true;
    else
    {
        $dig = str_split($data);
        $kontrola = (1*intval($dig[0]) + 3*intval($dig[1]) + 7*intval($dig[2]) + 9*intval($dig[3]) + 1*intval($dig[4]) + 3*intval($dig[5]) + 7*intval($dig[6]) + 9*intval($dig[7]) + 1*intval($dig[8]) + 3*intval($dig[9]))%10;
        if($kontrola == 0) $kontrola = 10;
        $kontrola = 10 - $kontrola;
        if(intval($dig[10]) == $kontrola)
            return true;
        else
            return false;
    }
  }
}

return validatepesel($data);
if (validatepesel($data) != 0){
   return true;
} else {
   return false;
}

2nd field:
PHP:
$panama = strtotime("2019/01/21");
$wiek14 = (14 * 60 * 60 * 24 * 365);
$pole = strtotime ($data);

if( $pole < ($panama - $wiek14)) {
  return true;
} else {
  return false;
}

3rd field:
Condition:
PHP:
$paszp_walid = '{zgloszenia___gr_etap1}';
$myUser = JFactory::getUser();
$myLevels = $myUser->getAuthorisedViewLevels();
if($paszp_walid = "1" AND !in_array(7, $myLevels)) {
return true;
} else {
return false;
}

PHP Code:
PHP:
$paszp_wazn = strtotime ( date('d-m-Y', strtotime(str_replace(".","-",$data))));
$paszp_data_wymagana = strtotime ("1 February 2019");

if($paszp_data_wymagana <= $paszp_wazn) {
  return true;
} else {
  return false;
}



#joomla3.8
 
The most likely problem is the max_input_vars in your PHP config, which is probably defaulted to 1000. Each element on your form uses two input (post) vars. So at 17 repeats of 24*2 ... plus whatever other elements you have ... that's a 1000. The server will just truncate at 1000, so the form submission (and moving between pages, which submits the form data for validation) will break.

Edit your php.ini, and increase that setting to (say) 2000. Also, do the math on your 80 repeats...

There is also a post_max_size (or something like that) you may need to increase as well.

Hugh


Sent from my Pixel 2 XL using Tapatalk
 
Ok, i change it. We'll see if the situation gets better.
I understand that PHP codes in the context of Fabrik optimalization are correct? :)
 
I don't see anything in the code you posted which would cause problems.


Sent from my Pixel 2 XL using Tapatalk
 
Unfortunately, it's still the same :(
Could you check the test record I created? There is 18 repeats and browser hang up, and mootols have mistake (attached screen). Please login on frontend by login and pass
 
Unfortunately, it's still the same :(
Could you check the test record I created? There is 18 repeats and browser hang up, and mootols have mistake (attached screen). Please login on frontend by login and pass
 
My host provider describe the PHP configuration instructions without any sense...
I thought I set it. However, no. :p Now i set it and check. This finally solved the problem :)
Thank You very, very much for help!! :)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top