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

content plugin returns [0] => Array

Discussion in 'Community' started by vladimir84, Sep 25, 2018.

  1. vladimir84

    vladimir84 Member

    Level: Community
    My content plugin shows me an empty list with no data. I don't understand what to do.

    Footer text of a form (while viewing the form, I want to see another table's entries for the common entry):
    {fabrik view=list id=12 db_articolo___Lotto=[commesse___commessa] fabrikdebug=1}

    The SQL query is fine, I ran it through another software and it returns all the entries correctly:
    Code (Text):
    SELECT SQL_CALC_FOUND_ROWS DISTINCT
    ...
    FROM `db_articolo`
    WHERE (   `db_articolo`.`Lotto` = '18A_ 3005_0'  )
    However, it returns nothing in the list.
    This is the debug output right after the query:

    Code (Text):
    table:data
    Array
    (
       [0] => Array
           (
           )

    )
    The exact same table is showing me the correct data when I do a URL placeholders (index.php?option=com_fabrik&view=list&listid=X)

    Thoughts, ideas?
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    What is the debug showing in getData (in the WHERE part)?
     
  3. vladimir84

    vladimir84 Member

    Level: Community
    this is what is shows:
    [​IMG]

    This is the list with the same filter:
    [​IMG]
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    There seems to be a space in the string.
    No idea what is happening in this case.
    You can't have a space in your URL so how did you "The exact same table is showing me the correct data when I do a URL placeholders"?

    Maybe it's URL or HTML encoded and so filtering the the wrong string.
     
  5. vladimir84

    vladimir84 Member

    Level: Community
    As you can see below, the URL is automatically supplemented for the space character. The data field has a space in the middle, but the query includes the whole string:
    [​IMG]
     
  6. vladimir84

    vladimir84 Member

    Level: Community
    So is this a bug or am I doing something wrong?
    Maybe if I could place a condition "the string begins with" and also to trim the first 3 characters of the [placeholder]+ "the string ends with" and to trim the last 5 characters of the [placeholder]?
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    What element type is 'lotto'?

    What happens if you copy the getData query from the debug output and run it in a MySQL client (like phpMyAdmin)?

    -- hugh
     
  8. vladimir84

    vladimir84 Member

    Level: Community
    it's just a field.
    I use the dbforge MySQL Studio, and it works perfectly, it prints out the expected result as shown below (this is just a copy-paste of the debug query, no addition from my side).
    [​IMG]
     
  9. troester

    troester Well-Known Member Staff Member

    Level: Community
    To exclude character/coding issues:
    is the content plugin working with a simple ASCII string (without any spaces, special characters etc.)?
     
  10. vladimir84

    vladimir84 Member

    Level: Community
    yes, I always type it in the "code" section of the editor, to avoid html pre-formatting. In any case I have to give up, as I have a deadline by Monday.
    I'll just use the form PHP plugin to do a SQL search and populate extra fields before processing.
    Another workaround would be to create a SQL view of the database where the extra space would be trimmed and then to create a list of that view, plus on the main table, a hidden calc field that does the same to the field with a space in between.
    In any way, thank you for your time and I hope this is still useful to you for possible debugging purposes.
     
  11. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I think what @troester means is, does it work if you add a filter in the content plugin that doesn't have spaces. So test by removing the space from one of your 'lotto' field values, filter for that without the space in the plugin text, and see if it shows.

    -- hugh
     

Share This Page