1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Googlemap visualization does not work when Calculation element active

Discussion in 'Community' started by Kordian, Nov 1, 2018.

  1. Kordian

    Kordian Member

    Level: Community
    Hi,
    Joomla 3.8, new version of php - migrated from 5.6 to 7.2.
    I have visualizations on google maps. They stopped working after the php upgrade - simply do not display anymore.
    I found that if I deactivate Fabrik element - Calculation in the backend, the visualizations start displaying correctly.
    Is that a bug of some kind?
    Of course, I need calculation for other purposes, so it is no solution for me.
    Do not ask me what these two elements have in common, I am not an expert and that is why I am writing here.
    Thanks in advance for any help!
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Which Joomla, which Fabrik version?
    Is your calc code php7.2?
    Check for JS errors in your browser dev console.
     
  3. Kordian

    Kordian Member

    Level: Community
    Joomla 3.8.12, Fabrik 3.8.1
    Do not understand question no 2.
    Do not know how to check for js errors, warned I am no expert :)
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    What is the code in your calc?

    There's no generic issue with using calcs with the map viz, so it's probably something specific to your PHP code in the calc which is causing problems in 7.2.

    -- hugh
     
  5. Kordian

    Kordian Member

    Level: Community
    Where to find this code? It has never been changed. Is standard and no changes to the Fabric calc element code has been made. Worked on Joomla 2.5, 3.8.12 with php 5.4 amd 5.6.
     
  6. Kordian

    Kordian Member

    Level: Community
    And I do not use this element in neither of the tables used for visualizations... If that is what you mean.
     
    Last edited: Nov 1, 2018
  7. Kordian

    Kordian Member

    Level: Community
    The visualisations are inserted into articles and articles applied to menu. When I turn the calculation element on and move to this article, I get the error "Invalid numeric literal"
     
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
  9. Kordian

    Kordian Member

    Level: Community
    As written before, I do not use any calculation in the visualizations. The rest works fine.
    I have this php code in different tables:

    if($data['gps_dane___RCON'] == '' || $data['gps_dane___RCON'] == 0){
    $data = (float)$data['gps_dane___speed']*3.6;
    }else{
    $data = (float)$data['gps_dane___speed']*1.852;
    }
    return round($data,2);

    These tables work fine.
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    The calc will still get executed, if it's on the table your viz uses.

    You are getting an error from PHP 7, because whatever is in gps_dane___speed is an invalid number. Either it starts with a 0 and has a digit more than 8 (PHP treats numbers starting with 0 as octal), or has some other non-numeric problem.

    You could try seeing what is in that data. Put this as the first line in your calc:

    Code (Text):

    var_dump($data['gps_dane___speed']);exit;
     
    ... and then load the viz. That should give you an otherwise blank page with just the debug output.

    Copy and paste that debug output here.

    -- hugh
     
  11. Kordian

    Kordian Member

    Level: Community
    OK, I managed to solve it myself. Thank you!
     

Share This Page