• Resolved serenadrake

    (@serenadrake)


    When we try to save a page with a table using Ninja Tables on it, if the table has a column of the data type “Image/File/Lightbox”, it throws the following error:
    Object of class stdClass could not be converted to string
    I was able to turn debug mode on on a test site and it narrowed to down to being in:
    …\public\wp-content\plugins\relevanssi\lib\compatibility\ninjatables.php
    on line 80
    I contacted Ninja Table’s support and they confirmed it would be completely on Relevanssi’s end and not theirs. Thankfully this doesn’t stop the page from saving, so I can work with it for now but it’s rather annoying.
    The bug seems to be easy to replicate too, every time I’d make a test table it would start to give the error once that type of column was in it.

    Thanks for any help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Yes, Relevanssi is the culprit here. I’d help, but the lightbox is a Pro feature, so I have no idea what it does or what it is.

    What does the lightbox look like in the wp_ninja_table_items database table?

    Thread Starter serenadrake

    (@serenadrake)

    If I export the .json file and import it onto Ninja Tables on a site that does not have Pro, it still causes the same issue. Would that file help?

    Here’s the value of one of the table rows from the database, this row has two columns, both images.

    `{“test”:{“permalink”:””,”image_thumb”:”https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-lightgray-300×13.png”,”image_full”:”https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-lightgray.png”,”alt_text”:”section wedge bottom lightgray”},”test_lb”:{“permalink”:””,”image_thumb”:”https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-darkgray-300×13.png”,”image_full”:”https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-darkgray.png”,”alt_text”:”section wedge bottom darkgray”}}’

    Plugin Author Mikko Saari

    (@msaari)

    Yes, that file would probably help. With those row columns alone, I can’t make this break the same way it breaks for you.

    Thread Starter serenadrake

    (@serenadrake)

    Alright, I’m not sure how to share a file with you from here, but since the file isn’t very large I’ll just paste the contents so you can save it as a .JSON:

    {"post":{"ID":5755,"post_author":"5","post_date":"2021-03-17 08:27:15","post_date_gmt":"2021-03-17 12:27:15","post_content":"","post_title":"test","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"test-2","to_ping":"","pinged":"","post_modified":"2021-03-17 08:27:15","post_modified_gmt":"2021-03-17 12:27:15","post_content_filtered":"","post_parent":0,"guid":"https:\/\/apt-local-test.local\/ninja-table\/test-2\/","menu_order":0,"post_type":"ninja-table","post_mime_type":"","comment_count":"0","filter":"raw"},"columns":[{"name":"test","key":"test","breakpoints":"","data_type":"image","dateFormat":"","header_html_content":"","enable_html_content":"false","contentAlign":"","textAlign":"","maxWidthUnit":"px","link_type":"none"}],"settings":{"perPage":20,"show_all":false,"library":"footable","css_lib":"semantic_ui","enable_ajax":false,"css_classes":["selectable","striped","vertical_centered"],"enable_search":true,"column_sorting":true,"default_sorting":"old_first","sorting_type":"by_created_at","table_color":"ninja_no_color_table","render_type":"legacy_table","table_color_type":"pre_defined_color","expand_type":"default","stackable":"no","stacks_devices":[],"stacks_appearances":[]},"data_provider":"default","metas":{"_ninja_table_columns":[{"name":"test","key":"test","breakpoints":"","data_type":"image","dateFormat":"","header_html_content":"","enable_html_content":"false","contentAlign":"","textAlign":"","maxWidthUnit":"px","link_type":"none"}],"_ninja_table_settings":{"perPage":20,"show_all":false,"library":"footable","css_lib":"semantic_ui","enable_ajax":false,"css_classes":["selectable","striped","vertical_centered"],"enable_search":true,"column_sorting":true,"default_sorting":"old_first","sorting_type":"by_created_at","table_color":"ninja_no_color_table","render_type":"legacy_table","table_color_type":"pre_defined_color","expand_type":"default","stackable":"no","stacks_devices":[],"stacks_appearances":[]}},"rows":[],"original_rows":[{"position":"1","owner_id":"5","attribute":"value","value":{"test":{"permalink":"","image_thumb":"https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-lightgray-300x13.png","image_full":"https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-lightgray.png","alt_text":"section wedge bottom lightgray"},"test_lb":{"permalink":"","image_thumb":"https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-darkgray-300x13.png","image_full":"https:\/\/local-test.local\/wp-content\/uploads\/2021\/01\/section-wedge-bottom-darkgray.png","alt_text":"section wedge bottom darkgray"}},"settings":null,"created_at":"2021-03-16 15:59:34","updated_at":"2021-03-16 16:44:41"}]}

    You should be able to import that and chose the ‘JSON exported from Ninja Tables’ option, when I do that it gives the error still, even though the Pro version is disabled and the images are broken.

    Thanks again by the way!

    Plugin Author Mikko Saari

    (@msaari)

    Thanks! I was able to fix this now. The fix is here in GitHub, you can take the /lib/compatibility/ninjatables.php and that should fix the problem.

    Thread Starter serenadrake

    (@serenadrake)

    Great, thanks a ton!

    Hi Mikko,

    Thanks for jumping on this. Are you planning to roll this fix out to Premium as well? I have a site that’s experiencing this that uses Premium, but it looks like 2.14.5 is still having this issue.

    Thank you!

    Konstantin

    Plugin Author Mikko Saari

    (@msaari)

    It’s coming both for free and Premium in the next version (which is coming some point in April; it’s going to be a bigger feature version, ie. 2.15, so it’ll be later in April). Meanwhile, you can just take the file from the Github, it’s the same file in free and Premium.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conflict with Ninja Tables’ is closed to new replies.