calc field after update 3.8

merlino68

Member
j.8 fabrik 3.8
after updating my calculation to calculate age does not work anymore.
the field is white
this is the calc :
$date= '{Anagrafica___Data_Nascita}';
$date = strtotime($date);
$now = time();
$diff = $now - $date;
$years = floor($diff / 31556926);
return $years;

thanks
 
upload_2017-10-13_16-11-25.png
I try a test , when this option is "NO" the field is blank , if YES I see the values in the field but no re-calculation in the table
 
In your calc you are using $date= '{Anagrafica___Data_Nascita}';
but you are watching {tm_anagrafica_clienti___data_nascita}
So what is your correct element name?
Did you try {your-element_raw}?
 
Sorry ......, this is my calc

$date= '{tm_anagrafica_clienti___data_nascita}';
$date = strtotime($date);
$now = time();
$diff = $now - $date;
$years = floor($diff / 31556926);
return $years;

I try {tm_anagrafica_clienti___data_nascita_raw}
but it does not work

thanks
 
Hello,
I have also the same issue. All my calc elements do not display in list view since my update to Fabrik 3.8. The value of the calc element is visible in form view.

My calculation:
return (float)'{pagamenti___quota_asso_raw}' + (float)'{pagamenti___pacchetto_raw}' - (float)'{pagamenti___sconto_raw}' + (float)'{pagamenti___lez_aggiunt_raw}';

My Joomla version is 3.8.1. But I got the problem before I updated Joomla.

Any ideas why?
Thank you
 
The only way to debug calc code is to install jdump:

https://github.com/mathiasverraes/jdump/downloads

... and put debug statement in the code so you can see what your various variables and placeholders are set to. Like ...

Code:
dump('{pagamenti___quota_asso_raw}', "some meaningful comment so you know what this should be");
dump('{pagamenti___pacchetto_raw}', "pagamenti___pacchetto_raw");

When you load the page, jdump will open a popup (so you'll probably have to tell your browser to allow it) with information for each dump() line you put in.

-- hugh
 
I just tried with your code:
It's empty in list view - if you don't return a string!
So
return (string)$years;
is doing.
Which may also solve @7webcreator ?

It seems something has become more sensitive about variable types.
 
Ah, interesting. Yes, that was from a commit I did a few months ago, working on speeding up list rendering. Turns out we can save a lot of time (like seconds) on big lists with lots of elements, that don't have tooltips, if we don't try and load the tooltip layout if the tooltip text is empty. Anyway, side effect of that was not showing non-string data.

Should be fixed as of:

https://github.com/Fabrik/fabrik/commit/c03fbe7766cac30082e16e8ea81526153adf3f0d

-- hugh
 
Ah, interesting. Yes, that was from a commit I did a few months ago, working on speeding up list rendering. Turns out we can save a lot of time (like seconds) on big lists with lots of elements, that don't have tooltips, if we don't try and load the tooltip layout if the tooltip text is empty. Anyway, side effect of that was not showing non-string data.

Should be fixed as of:

https://github.com/Fabrik/fabrik/commit/c03fbe7766cac30082e16e8ea81526153adf3f0d

-- hugh

Thank you very much. That's solved my problem too.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top