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

Warning and notice even when no debbug

Discussion in 'Standard Support' started by creanet, Apr 26, 2019.

  1. creanet

    creanet New Member

    Level: Professional
    Hi,
    I had this warning :
    Warning: count(): Parameter must be an array or an object that implements Countable in /home/toursinnei/www/components/com_fabrik/models/element.php on line 4352
    I update from github just in case but now I have still the warning plus this notice :
    Notice: Array to string conversion in /home/toursinnei/www/components/com_fabrik/views/list/view.base.php on line 71
    Joomla! and Fabrik debug is off but I still got the message.
    exemple : https://tours-in-normandy.fr/fr/cir...-seine-entre-le-havre-et-rouen-normandie.html at the bottom of the page.
    Thx for your help
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    It seems there's still a spot which needs to be updated for php7.2
    Do you have custom query strings definded in your list's CSV settings?

    You should not see these warnings/notices with Joomla's error reporting off.
     
  3. creanet

    creanet New Member

    Level: Professional
    No I don't have custom query in my list's CSV sttings.
    But I call a layout from another template with this code :
    {fabrik view=list id=5 fk_voyages___id[value]=<?php echo $voyage_id->value;?> fk_voyages___id[condition]=&lt;&gt; fk_voyages___category[value]=<?php echo $voyage_cat;?> fk_voyages___category[condition]=IN fk_voyages___status=1 limit=4 resetfilters=1 clearfilters=1 layout=related-voyages}
    Maybe that's the reason why I see the messages even whith Joomla's error reporting off.
     
  4. creanet

    creanet New Member

    Level: Professional
    Hi, I change my PHP version to php 7.1. The warning for the count() is gone but I still have the Notice: Array to string conversion in /home/toursinnei/www/components/com_fabrik/views/list/view.base.php on line 71
    when I add
    var_dump($val);
    var_dump($key);
    after the line 71, I have :
    Notice: Array to string conversion in /home/toursinnei/www/components/com_fabrik/views/list/view.base.php on line 71
    array(2) { ["value"]=> string(2) "11" ["condition"]=> string(2) "<>" } string(15) "fk_voyages___id"
    Notice: Array to string conversion in /home/toursinnei/www/components/com_fabrik/views/list/view.base.php on line 71
    array(2) { ["value"]=> string(7) "Circuit" ["condition"]=> string(2) "IN" } string(21) "fk_voyages___category" string(1) "1" string(19) "fk_voyages___status"
    wich correspond to the filter on the call to the other template :
    {fabrik view=list id=5 fk_voyages___id[value]=<?php echo $voyage_id->value;?> fk_voyages___id[condition]=&lt;&gt; fk_voyages___category[value]=<?php echo $voyage_cat;?> fk_voyages___category[condition]=IN fk_voyages___status=1 limit=4 resetfilters=1 clearfilters=1 layout=related-voyages}
    What did I do wrong ?
    Thx for your help
     
  5. troester

    troester Well-Known Member Staff Member

    Level: Community
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I presume that list is being included with a content plugin?

    If so, what is your plugin string?

    -- hugh
     
  7. creanet

    creanet New Member

    Level: Professional
    Hi,
    No, in components/com_fabrik/views/details/tmpl i have a bunch of custom template. In one of the php files there is a call to another with this request :
    {fabrik view=list id=5 fk_voyages___id[value]=<?php echo $voyage_id->value;?> fk_voyages___id[condition]=&lt;&gt; fk_voyages___category[value]=<?php echo $voyage_cat;?> fk_voyages___category[condition]=IN fk_voyages___status=1 limit=4 resetfilters=1 clearfilters=1 layout=related-voyages}

    In $voyage_id->value and $voyage_cat->value I have strings but with the var_dump I see that it's not just the value that is taken, it's an array with the value and the condition.

    Thx for your help
     
  8. creanet

    creanet New Member

    Level: Professional
  9. troester

    troester Well-Known Member Staff Member

    Level: Community
    Issue confirmed:
    In
    protected function csvJS
    it seems it can only handle simple filters like table___element=foo.

    No idea why it is running this on all list displays (even if csv export is disabled).

    The list itself is filtered correctly and also (filtered) csv export is working.

    But with Joomla error reporting set to "simple"or "none" the notice won't show.
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Ah, I think I might be able to remove that entire chunk of code. That was an early attempt at fixing filtering in CSV output, which I don't think is needed any more.

    I'll test it now.

    -- hugh
     
  11. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    OK, yup, I've removed that code, wasn't needed.

    -- hugh
     
  12. creanet

    creanet New Member

    Level: Professional
    Thanks a lot I've update via FTP and no more notice. :D
     
    cheesegrits likes this.

Share This Page