1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

error after upgrade (SOLVED)

Discussion in 'Professional Support' started by creanet, Jul 26, 2018.

Thread Status:
Not open for further replies.
  1. creanet

    creanet New Member

    Level: Professional
    Hi,
    I took over a project that was already partially developed but with joomla 3.7.4 and fabrik 3.7, when I upgrade to joomla 3.8.10 and fabrik 3.8.1 with joomla manager I've got an error on the homepage (due to a module list but the same error is on the list "page") : 1054 Unknown column 'fk_themes_0.theme' in 'order clause'. I make a git update and now I have
    Fabrik has generated an incorrect query for the list Voyages - public :
    Unknown column 'fk_themes.parent_id' in 'where clause'
    And nothing in the console
    Could you please help me ? If needed all the joomla details are in my profile.
    Thx
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Can you add a backend superadmin access?
    Create an extra one which can be disabled if not longer needed.
     
  3. creanet

    creanet New Member

    Level: Professional
    it's already done you have the info in my sites
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    Ah, ok, the site is pointing to the frontend.
     
  5. creanet

    creanet New Member

    Level: Professional
    Oh sorry I add the administrator
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    It's the element Inspirations (name =themes), dbjoin as checkbox in the Voyage - public list.
    I have disabled it and the error is gone.
    But I don't know what is the reason (it's referring to the wrong table).

    Do you have a backup of your site?
    I would try to edit this element (=Click unlink...) and resave.
     
  7. creanet

    creanet New Member

    Level: Professional
    Yes go ahead I have an akeeba backup
     
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    Ok, it seems to be fixed now.
     
  9. creanet

    creanet New Member

    Level: Professional
    Thx a lot
     
  10. creanet

    creanet New Member

    Level: Professional
    How did you do it, I have 500 errors on lists 45, 46, 53, 63, 69 and 104 and would like to try your solution please
     
  11. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I had a look at the site, fixed one or two issues, but found some others.

    I tried installing the site here with an Akeeba backup, so I can debug the issues, but I hadn't noticed your database is on a remote host, so it doesn't work from here. Is it possible to give me access from here?

    -- hugh
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    OK, I figured it out.

    You (or whoever you inherited this from) had set "Record in Database" to "No" on a bunch if your forms. This breaks pretty much anything that has to do with ... well, the database. Including building join queries, which is what was blowing up.

    This isn't something that would have happened during an update, someone would have had to have manually set that option.

    You should NEVER set that to "No" on a form, if you actually have a database table and corresponding List.

    I set it back to Yes on form ID's 45 and 46, and both seem to be working now. You should be able to just set that to Yes (it's under the "Form Processing" tab) on the other affected forms.

    -- hugh
     
  13. creanet

    creanet New Member

    Level: Professional
    OK thx I'll try that on the other forms
     
  14. creanet

    creanet New Member

    Level: Professional
    OK now I have notices and warning that wasn't there before the update :
    Lists 19, 54, 87, 97, 99 :
    Notice: Trying to get property of non-object in /home/toursinnei/www/plugins/fabrik_element/calc/calc.php(304) : eval()'d code on line 6
    List 44:
    Notice: Undefined index: join___144___fk_etapes___activites in /home/toursinnei/www/plugins/fabrik_element/calc/calc.php(304) : eval()'d code on line 6
    Warning: Invalid argument supplied for foreach() in /home/toursinnei/www/plugins/fabrik_element/calc/calc.php(304) : eval()'d code on line 10
    And list 83:
    Warning: Division by zero in /home/toursinnei/www/plugins/fabrik_element/calc/calc.php(304) : eval()'d code on line 6

    On list 69 I have:
    500 Fabrik has generated an incorrect query for the list Recherche libre: <br /><br /><pre>Unknown column '780' in 'order clause'</pre>
    /home/toursinnei/www/components/com_fabrik/models/list.php:937
    And on
    List 72:
    Fatal error: Call to a member function getOrderByName() on boolean in /home/toursinnei/www/plugins/fabrik_list/order/order.php on line 79

    This 2 errors where apparently there also before the update but I would like some help with this too, should I open a new thread?
     
  15. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Anything that says "eval()'d code" means it's in code you (or whoever) wrote, in this case in a calc element.

    I strongly suspect those warnings were there, you just didn't have error reporting turned on, so you never saw them before.

    The first one, list 19, seems to be in the "Suivi client" calc ... which starts with this:

    Code (Text):

    $db = JFactory::getDbo();
    $fk = $db->Quote('{fk_demandes___id}');
    $query = "SELECT fk_actions_story.datetime as date_time, fk_actions.nom_action as action, #__content.title as modele FROM fk_actions_story INNER JOIN fk_actions ON fk_actions_story.action=fk_actions.id LEFT JOIN #__content ON fk_actions_story.modele_email=#__content.id WHERE fk_actions_story.demande_id=$fk ORDER BY fk_actions_story.id DESC LIMIT 1";
    $db->setQuery($query);
    $action = $db->loadObject();
    $date_action=strftime ("%d-%m-%Y",strtotime($action->date_time));
    if(!empty($action)){
    ...
     
    ... the error is telling us "Trying to get property of non-object ... on line 6", and line 6 ...

    Code (Text):

    $date_action=strftime ("%d-%m-%Y",strtotime($action->date_time));
     
    ... has $action->date_time on it ... but if that query doesn't return anything, and $action is empty ... trying to access $action->date_time will give that error, "trying to get property of a non-object".

    So it should be ...

    Code (Text):

    $action = $db->loadObject();
    if(!empty($action)){
    $date_action=strftime ("%d-%m-%Y",strtotime($action->date_time));
    ...
     
    ... ie. don't try and access $action->date_time till you've checked that $action is not empty.

    I've fixed it on list 19, it's probably something similar on 54, 87, 97 and 99. You'll need to check each calc element in those forms, and see if line 6 does something similar, trying to access an object property (the -> syntax, so $foo->bar, where 'bar' is a property of the 'foo' object).

    I'll look at the other types of error and get back to you.

    -- hugh
     
    Last edited: Jul 27, 2018
  16. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    This one ...

    ...is due to the calc "Photos des activit├ęs", which doesn't actually do anything ...

    Code (Text):

    // Replace these two lines with your element's values
    $joinId = '144';
    $fullElementName = 'fk_etapes___activites';

    // $vals is an array - it contains values of either 0 (not selected) or other
    $vals = $data['join___' . $joinId . '___' . $fullElementName];

    // Lets just get the selected values in a new array '$selected'
    $selected = array();
    foreach ($vals as $val)
      {
        if ($val != 0)
        {
          $selected[] = $val;
        }
    }
     
    That code is boilerplate stuff from Fabrik 2.x and 3.0, it doesn't apply to 3.1+ ... we no longer store joined data in that 'join___X___table___element' naming format. So that's giving a warning because that key doesn't exist in the $data array, and because the code then tries to do a foreach() on a null variable ... and then the code never returns anything anyway, so that calc would never have displayed anything anyway.

    So as it is broken code and doesn't return anything, I've unpublished it.

    -- hugh
     
  17. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    OK, this one:

    ... was due to 5 of the calcs on that form, which do something similar to this:

    Code (Text):

    $db = JFactory::getDbo();
    $devise = $db->Quote('{fk_prestations___devise_achat_raw}');
    $query = "SELECT taux_conversion FROM fk_devises WHERE id=$devise LIMIT 1";
    $db->setQuery($query);
    $taux = $db->loadResult();
    $prix_achat_euros = "{fk_prestations___prix_achat}" / $taux;
    return sprintf("%01.2f", $prix_achat_euros);
     
    ... where they look up $taux in the database, and divide by it ... but don't check to see if the query actually returned anything ... and if it didn't (or if it returned 0) then line 6 winds up dividing by 0 ... which is of course an error.

    I've modified them all to do (something like) this:

    Code (Text):

    $db = JFactory::getDbo();
    $devise = $db->Quote('{fk_prestations___devise_achat_raw}');
    $query = "SELECT taux_conversion FROM fk_devises WHERE id=$devise LIMIT 1";
    $db->setQuery($query);
    $taux = $db->loadResult();

    if (!empty($taux)) {
      $prix_achat_euros = "{fk_prestations___prix_achat}" / $taux;
      return sprintf("%01.2f", $prix_achat_euros);
    }

    return '0';
     
    ... so it only does the actual division and returns a formatted result if $taux is not empty, and if it's empty, returns '0'.

    -- hugh
     
  18. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I just edited the list settings and re-saved them, it cleared up.

    -- hugh
     
  19. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    The 'order' plugin on that list wasn't configured correctly - no "order element" was specified. I can't see an obvious element to set as the "order by", which would typically be a field that the plugin will re-set when you drag and drop the rows to order them, so I just unpublished the plugin.,

    -- hugh
     
  20. creanet

    creanet New Member

    Level: Professional
    Ok thx a million, no more errors , notices or warnings on my lists :)
     
    cheesegrits likes this.
Thread Status:
Not open for further replies.

Share This Page