Okay
  Public Ticket #2703766
Charts / Tables with WPBakery
Closed

Comments

  •  2
    Lori started the conversation

    Hello,

    I noticed something odd regarding the embedding of charts into posts/pages. Originally for testing purposes, I used the shortcode in a paragraph element (within WPBakery Page Builder, formerly Visual Composer) to embed a chart. At some point, I changed the name of the related table so that it would match the name of the chart. I had also decided, for user-friendliness, I should use the wpDataChart element in WPBakery instead of the shortcode. What I found was that the WPBakery element did not show up for that chart, but it would show up if I set it to a different chart. The shortcode did still seem to work, however. I thought this was a caching issue or something, but no matter what I did, the chart would not show up when I used the element. I tried to re-add and re-set the element to point to the correct chart. The only way to solve it each time was to create a new chart and point it to the renamed table. Somehow the connection was getting lost.

    Also, if I embed a table, it shows up when in WPBakery's frontend editor. If I embed a chart, nothing shows up, until you leave editing mode. This made it very hard to find the charts in the frontend editor, so I added some CSS that will at least outline the element and label it whether it is embedded with a shortcode or with an element. Attached you can see how I made it visible in editing mode. Perhaps this issue is caused by something in our configuration or our old server software that I have no control over, but in case it isn't, I thought I would mention it.

  • [deleted] replied

    Hi Lori

    Thank you for reaching out to us.

    Our entire documentation is created through WPBakery's elements so this should not be happening.

    Can I kindly ask you to provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.

  •   Lori replied privately
  • [deleted] replied

    Hi Lori

    Unfortunately we do not have the option to do a screen sharing session but if you could duplicate the website and send us the file that would be greatsmile.png 

  •  2
    Lori replied

    I will send the Duplicator plugin through our risk assessment. This will take some time.

  •  2
    Lori replied

    I had another issue where the connection between the WPBakery element connection to a chart was lost. I had gone in to the tables and charts to make some screen captures for Aleksandar for another ticket. I didn't change anything. However, now that chart is no longer showing up on the page. The only other thing that might have affected this was that I had to re-create different table and chart because the chart had disappeared. It was the first one in the list, but after I removed the old versions, this one became the first in the list. Maybe the element doesn't like the first chart in the list?

    I am going to swap out the elements with shortcode instead as it seems more stable.

  • [deleted] replied

    Hi Lori

    Does the chart work in the back-end?

    Have you tried the fix for follow table filtering?

    In file wp-content/plugins/wpdatatables/source/class.wpdatachart.php on line 2706 you will find this

     if ($this->getFollowFiltering()) {

    add this code on end of that if statment

     if (get_option('wdtIncludeBootstrap') == 1) {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                } else {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/noconf.bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                }
                wp_enqueue_script('wdt-bootstrap-select', WDT_JS_PATH . 'bootstrap/bootstrap-select/bootstrap-select.min.js', array(), WDT_CURRENT_VERSION, true);
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_settings', WDTTools::getDateTimeSettings());
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_frontend_strings', WDTTools::getTranslationStrings());

    So your code will look like this:

    if ($this->getFollowFiltering()) {
                wp_enqueue_script('wdt-common', WDT_ROOT_URL . 'assets/js/wpdatatables/admin/common.js', array('jquery'), WDT_CURRENT_VERSION, true);
                if ($minified_js) {
                    wp_enqueue_script('wdt-wpdatatables', WDT_JS_PATH . 'wpdatatables/wdt.frontend.min.js', array('wdt-common'), WDT_CURRENT_VERSION, true);
                    wp_localize_script('wdt-wpdatatables', 'wdt_ajax_object', array('ajaxurl' => admin_url('admin-ajax.php')));
                } else {
                    wp_enqueue_script('wdt-datatables', WDT_JS_PATH . 'jquery-datatables/jquery.dataTables.min.js', array(), WDT_CURRENT_VERSION, true);
                    wp_enqueue_script('wdt-funcs-js', WDT_JS_PATH . 'wpdatatables/wdt.funcs.js', array('jquery', 'wdt-datatables', 'wdt-common'), WDT_CURRENT_VERSION, true);
                    wp_enqueue_script('wdt-wpdatatables', WDT_JS_PATH . 'wpdatatables/wpdatatables.js', array('jquery', 'wdt-datatables'), WDT_CURRENT_VERSION, true);
                }
                if (get_option('wdtIncludeBootstrap') == 1) {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                } else {
                    wp_enqueue_script('wdt-bootstrap', WDT_JS_PATH . 'bootstrap/noconf.bootstrap.min.js', array('jquery', 'wdt-bootstrap-select'), WDT_CURRENT_VERSION, true);
                }
                wp_enqueue_script('wdt-bootstrap-select', WDT_JS_PATH . 'bootstrap/bootstrap-select/bootstrap-select.min.js', array(), WDT_CURRENT_VERSION, true);
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_settings', WDTTools::getDateTimeSettings());
                wp_localize_script('wdt-wpdatatables', 'wpdatatables_frontend_strings', WDTTools::getTranslationStrings());
            }

    If the same chart works with the short-code we will still need the duplicated website to debug. 

  •   Lori replied privately
  • [deleted] replied

    Hi Lori

    We will need the duplicator of the site where you have this issue, so if you have this issue on the live server and not the test one we will need that duplicated and vice versa.

  •  2
    Lori replied

    Blaženka,

    Apologies again for the long delay in replying. I was trying to find time to get familiar with how Duplicator works and when I start to create a package, one of the notices says that multisite is not supported in the free version. So I have no idea what it will provide to you. It also indicates that the size will be 4.17GB which sounds like it is more than just the sub-site I was trying to provide. I don't have enough space in my Dropbox for that. I'm thinking that Duplicator will not work for this unless we purchase the pro version. Since using the shortcode and not the WPBakery elements seems to be more stable, I'm going to continue with that even though it is less intuitive for our client.

    When the time rolls around again for them to post more charts, I might try the fix you provided below. But, until then, I have to stay working on other projects. All I can suggest to you in the meantime is to try to re-create the issue by creating a table and then making a chart and placing it on a page with the WPBakery element. Then go back in and make some changes to the table, like maybe renaming it or something. Clear your caches, if needed, and then see if the chart is still visible. For me it loses its connection to the table, whereas the shortcode does not.

    Thank you,
    Lori

  • [deleted] replied

    Hi Lori

    Unfortunately we are still not able to recreate the issue you were facing, but as you say yourself, the shortcode seems to be more stable for you so we can just suggest to continue using that method.

    I wish we could be more helpful, but if there is anything else we can do please don't hesitate to let us know.

    Have a wonderful day!

  •  2
    Lori replied

    Blaženka,

    Thank you! Maybe when the group managing our server gets the software updated, the issue might magically fix itself.  :-)

    Lori

  • [deleted] replied

    Fingers crossed!

    But do let us know if there is anything else we can do to help the magicsmile.png

    Have a wonderful day