Author Topic: Code module error  (Read 441 times)

Offline dehuisman

  • Posts: 24
  • Gender: Male
Code module error
« on: April 30, 2018, 03:32:59 PM »
In case of multiple code modules in one page an erorr occurs for the load_helper function in wb_wrapper_edit_are a.php file.
This function is not checked on existence and can therefor throw an error. Result is that the second code block and all subsequent blocks are not shown (in admin of course while this is an admin function) .
Solution: 

Replace the loader_help  function with:

Code: [Select]
if (!function_exists('loader_help')) {
function loader_help()
{ ?>
<script>
/*<![CDATA[*/
        var url  = '<?php print WB_URL?>/include/editarea/edit_area_full.js';
        try{
            script = document.createElement("script");
            script.type = "text/javascript";
            script.src  = url;
            script.charset= "UTF-8";
            head = document.getElementsByTagName("head")[0];
            head[0].appendChild(script);
        }catch(e){
            document.write("<script src='" + url + "' charset=\"UTF-8\"><"+"/script>");
        }
/*]]>*/
</script>

<?php }
}

Offline dbs

  • Betatester
  • **
  • Posts: 7920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Code module error
« Reply #1 on: April 30, 2018, 04:03:56 PM »
Hi, the problem and solution is known. In next WB version the code module will be fixed.
I can recommend the more flexible module code2.