Visual Composer not working properly in CoursePress Test Module.

I have just added the following VC code to one of the other programs and it works on Course Setup > Step 2 - Course Details, but it doesn't work on Units > Text Module?

It breaks when used in Text Module: https://monosnap.com/file/0EUcKRAunjQZmJXazka13E8Gs6TkqF

Course details or Normal page/post: https://monosnap.com/file/nB2qfRWbeh7j8UvAvdxS7RDYtZbVRP

[vc_row][vc_column][vc_tta_accordion style="flat" shape="square" color="white" active_section="10" no_fill="true" collapsible_all="true"][vc_tta_section title="Phase 1: Six (6) online training modules" tab_id="XXX-XXX-XXX-9810-f0286062-8a75"][vc_column_text]

Six online training modules must be satisfactorily completed. These modules comprise lecture style videos on social science and skill based topics essential to ICL work and are delivered by nationally recognized subject matter experts.

In addition to videos, essential reading as well as recommended resources are identified for each module. Each of these mandatory training modules will require the trainee to complete online testing on the content of both the videos and essential reading identified in the module.

Six online training modules must be satisfactorily completed. These modules comprise lecture style videos on social science and skill based topics essential to ICL work and are delivered by nationally recognized subject matter experts.

In addition to videos, essential reading as well as recommended resources are identified for each module. Each of these mandatory training modules will require the trainee to complete online testing on the content of both the videos and essential reading identified in the module.

[/vc_column_text][/vc_tta_section][/vc_tta_accordion][/vc_column][/vc_row]

Please help.

  • Adam Czajczyk

    Hello carl

    I hope you're well today!

    I've been testing that on my end and it seems that something's affecting character encoding while the shortcode is being processed. I wasn't able to pinpoint yet so I've forwarded the case to our developers so they could look into it.

    Please note: it might take them a bit longer to respond than it takes us on forum here so please keep an eye on this ticket for further information and we'll update you here as soon as we got to know more about the issue and possible solution.

    Kind regards,
    Adam

  • Panos

    Hi carl ,

    In the mu-plugins/cp.php file, I added the following:

    add_action( 'coursepress_normal_items_loaded', function(){
    	remove_filter('the_content','wptexturize');
    });

    which seems to work. I did a test using the Test Course. It has one unit and two modules. In the second one, the text module I added that shortcode and seems to display the link properly.

    Could you check if this works in your other modules too and let us know?

    Thanks!

  • Predrag Dubajic

    Hi Carl,

    In your theme custom CSS I have added below code that will remove padding from VC elements inside units so that should do the trick.
    This is added inside Appearance > Customize > Additional CSS field:

    .unit .module-container > .module-content > section.container-wrap {
        padding: 0!important;
    }

    Also, will the above code changes be lost when the theme and plugin is updated? If so can you please provide all instructions on how to add again, thanks...

    That workaround has been added as cp.php a file inside your wp-content/mu-plugins/ folder so it will not be affected by the plugin update.

    Best regards,
    Predrag

  • Panos

    Hi carl ,

    I have replaced following files in you CuorsePress plugin folder:
    coursepress/2.0/include/coursepress/class-module.php
    which contains to new filters that should be included in next release. Those can be used in a mu-plugin to override default action. So instead of fetching content we can reload the page, so the shortcodes can be executed as expected.
    The second file replaced is:
    coursepress/2.0/asset/js/front.js
    This is required in order to execute the action from the response.

    I have also added a new mu-plugin file cp-reload-modules-on-next.php. This uses the filters I mentioned above.

    I have also renamed the existing mu-plugin that would ovverride the next click action to _cp-override-module-submit.php.back-2 so it doesn't load.

    I have tested this with user wpmuone and seems to ork fine on your site. I would recommend to do a few tests on your own too and let us know if you still have this issue.

    Kind regards!

  • Rupok

    Hi carl,

    I've reverted the changes mentioned in this ticket as you requested in live chat. I've replaced your "coursepress" plugin files with fresh copies. You can still get the previous copy as a zip file in the "plugins" directory named "coursepress_modified.zip". Also, I've renamed "_cp-override-module-submit.php.back-2" to "_cp-override-module-submit.php". There was no custom CSS code in your Theme's custom CSS area when I checked. "mu-plugins/cp.php" file was empty when I checked.

    I've also requested our SLS team to have a look at this. Looking forward to hearing from you and resolving this issue as soon as possible.

    Have a nice day. Cheers!
    Rupok

  • Panos

    Hi carl ,

    Sorry to hear you had issue after this change. I did test and it was working fine as I could see the Visual Composer's accordion.

    I see Rupok has installed a fresh copy of CoursePress.

    Could you please explain what was broken? Are you talking about the accordion or something else?

    Just FYI, those modification I did would only affect the coursepress check, if it should reload the page or load the content in an i-frame which would not execute the do_shortcode function. I deactivated the initial _cp-override-module-submit.php mu-plugin, but those actions were replaced be the new modifications. I have reactivated it.

    The site is loading very slow for me so it will take me some time to check again. Could you please have another look and confirmed if the previous state has been restored? Also don't forget to provide information about what is broken.

    Thanks!

  • carl

    Hi P,

    Up until a few days ago, before the last set of changes, it showed correctly, now it is broken again to the original state.

    I have explained the issue many times! So here we go again.

    1. Image A - On this page the VC Accordion works perfect https://icl.gov.au/courses/icl-online-training-program/

    2. Image B - On ALL units pages it looks like this.

    3. Image C - And when you click on it, it opens but doesn't shut.

    4. Once the above is fixed (to its previous state that you fixed and was working) the issue then was;
    - if you answered all the questions in a unit and then clicked on "Next", and, if you got a wrong answer and you went back to that page, the Accordion would just show code (see below as an example) and not the Accordion.

    [vc_row][vc_column][vc_tta_accordion style="flat" shape="square" color="white" active_section="10" no_fill="true" collapsible_all="true"][vc_tta_section title="Profile - Her Honour Justice Judy Ryan, Judge of the Appeal Division of the Family Court of Australia." tab_id="1539042159810-f0286062-8a748"][vc_column_text]The Honourable Justice Judy Ryan is a judge of the Appeal Division of the Family Court of Australia.  Justice Ryan was an inaugural appointee to the now Federal Circuit Court (2000) and to the Family Court of Australia in July 2006. She has a long career in social justice and was the Director of the Family Law Division at Legal Aid NSW.[/vc_column_text][/vc_tta_section][/vc_tta_accordion][/vc_column][/vc_row]

    I really hope you can get this fixed ASAP, i just dont understand why, how, its such an issue.

    Thanks again...

  • Panos

    Thanks for the explanation!

    When you mentioned broken I wasn't sure if you meant something more general as the next button which I was focused seemed to be working fine.

    I replaced those 2 files as I did before. The files are :
    coursepress/2.0/include/coursepress/class-module.php
    and
    coursepress/2.0/asset/js/front.js

    I have kept the original files backed up in the same folders.

    On their own those 2 files don't do anything, I have added 2 new filters there, which should be included in next release.

    In the cp.php in the wp-content/mu-plugins folder I have made use of those filters where I have added:

    add_filter( 'coursepress_module_submit_atts-has_error', function( $data ){
    
    	$data['data']['is_reload'] = true;
    	return $data;
    
    }, 20);
    
    add_filter( 'coursepress_module_submit_atts', function( $data ){
    
    	$data['data']['is_reload'] = true;
    	return $data;
    
    }, 20);

    These make sure that when clicking on the next buttons, it will reload instead of fetching in an i-frame, so shortcodes should be working as in the_content

    In that same file I have also re-added the

    add_action( 'coursepress_normal_items_loaded', function(){
        remove_filter('the_content','wptexturize');
    });

    which was missing (not sure why it was missing). This shoull fix the issue where the accordion is visible but looks broken.

    With the file changes I mentioned, you don't really need any of the other mu-plugins, so they are all deactivated, except the cp,php. They are still in the mu-plugins folder with changed fie extensions so they don't get loaded.

    As your server is located fast away and I have really slow responses here, I created a lighter test course, which loads fast here, with basic units and modules in order to test those changes on your site. I have set it to draft. After testing, if you see those issues are fixed you can delete that.

    Please let us know how it goes and in case you still have issues we'll check asap!

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.