WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.10.x) »
  • General Help & Support »
  • Lots of warnings in php_errorlog
  • Print
Pages: [1]   Go Down

Author Topic: Lots of warnings in php_errorlog  (Read 17007 times)

johnbroeckaert

  • Guest
Lots of warnings in php_errorlog
« on: January 10, 2018, 05:28:41 PM »
Hi,

I updatrs my site to 2.10 and I use a lot of droplets to show content on different pages.
My errorlog is full of theze warnings:
Code: [Select]
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"
2018-01-10T15:37:16+00:00 [E_NOTICE] /modules/droplets/droplets.php(37) : eval()'d code:[19] from /modules/droplets/droplets.php:[86] do_eval "Undefined variable: section_id"

Everything is working but do I have to do something?
Thanks
Logged

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4548
  • Gender: Male
Re: Lots of warnings in php_errorlog
« Reply #1 on: January 10, 2018, 05:43:15 PM »
Hallo,

that means, in one of your droplet you have an error in line 19. There is call of a none existing variable
"Undefined variable: section_id". Pls check your droplet code.

Dietmar
Logged
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

johnbroeckaert

  • Guest
Re: Lots of warnings in php_errorlog
« Reply #2 on: January 10, 2018, 07:37:17 PM »
Hallo Dietmar,

These errors come with the droplets in the 2.10 package version 3.0.22 . Mostly SectionPicker.
This is the code of this droplet:

Code: [Select]
global $database, $wb, $TEXT, $DGTEXT;
$content = '';
$sid = isset($sid) ? intval($sid) : 0;
if( $sid ) {
$sql  = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
$sql .= 'WHERE `section_id`='.$sid;
if (($module = $database->get_one($sql))) {
if (is_readable(WB_PATH.'/modules/'.$module.'/view.php')) {
$_sFrontendCss = '/modules/'.$module.'/frontend.css';
if(is_readable(WB_PATH.$_sFrontendCss)) {
$_sSearch = preg_quote(WB_URL.'/modules/'.$module.'/frontend.css', '/');
if(preg_match('/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $wb_page_data)) {
$_sFrontendCss = '';
}else {
$_sFrontendCss = '<link href="'.WB_URL.$_sFrontendCss.'" rel="stylesheet" type="text/css" media="screen" />';
}
} else { $_sFrontendCss = ''; }
ob_start();
[b]$oldSid = $section_id; // save old sectionID[/b]
$section_id = $sid;
require(WB_PATH.'/modules/'.$module.'/view.php');
$content = $_sFrontendCss.ob_get_clean();
$section_id = $oldSid; // restore old sectionID
}
}
}
return $content;


The thick line is nr 19.
Thanks
Logged

Offline jacobi22

  • Betatester
  • **
  • Posts: 5921
Re: Lots of warnings in php_errorlog
« Reply #3 on: January 10, 2018, 07:56:40 PM »
add $section_id to the line with the global, seperated by comma
like
Code: [Select]
global $database, $wb, $TEXT, $DGTEXT,$section_id,$page_id;

Here the new Code from the repaired Droplet Section Picker, included in WB 2.11

global $database, $wb, $TEXT, $DGTEXT,$section_id,$page_id;
    
$sRetVal = '';
    
$content = '';
    
$_sFrontendCss = '';
    
$sid = isset( $sid) ? intval( $sid) : 0;
    if ( 
intval( $sid) > 0) {
        
$now = time();
        
$sql = 'SELECT `s`.*'
              
.     ', `p`.`viewing_groups`'
              
.     ', `p`.`visibility`'
              
.     ', `p`.`menu_title`'
              
.     ', `p`.`link` '
              
. 'FROM `'.TABLE_PREFIX.'sections` `s`'
              
. 'INNER JOIN `'.TABLE_PREFIX.'pages` `p` '
              
.    'ON `p`.`page_id`=`s`.`page_id` '
              
. 'WHERE `s`.`section_id` = '.( int)$sid.' '
              
.   'AND ('
              
.         '('.$now.'>=`s`.`publ_start` OR `s`.`publ_start`=0) AND '
              
.         '('.$now.'<=`s`.`publ_end` OR `s`.`publ_end`=0) '
              
.       ')'
              
.   'AND `p`.`visibility` NOT IN (\'deleted\') '
              
.   '  ';
        if ( 
$oSection = $database->query( $sql)) {
            while ( 
$aSection = $oSection->fetchRow( MYSQLI_ASSOC)) {
                
$section_id = $aSection['section_id'];
                
$module = $aSection['module'];
                
ob_start();
                require ( 
WB_PATH.'/modules/'.$module.'/view.php');
                
$content = ob_get_clean();
                
$_sFrontendCss = '/modules/'.$module.'/frontend.css';
                
$_sFrontendCssrUrl = WB_URL.$_sFrontendCss;
                
$_sSearch = preg_quote( WB_URL.'/modules/'.$module.'/frontend.css', '/');
                if ( 
preg_match( '/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $content)) {
                    
$_sFrontendCss = '';
                } else {
                    
$sFrontend = '/modules/'.$module.'/frontend';
                    
$sFrontendJsFile  = (is_readable(WB_PATH.$sFrontend.'.js')?WB_URL.$sFrontend.'.js':'"";');
                    
$sFrontendCssFile = (is_readable(WB_PATH.$sFrontend.'.css')?WB_URL.$sFrontend.'.css':'"";');
                    
$_sFrontendCss = '
                      <script>
                      <!--
                          try {
                              var ModuleCss = '
.$sFrontendCssFile.'
                              var ModuleJs  = '
.$sFrontendJsFile.'
                              if (ModuleCss!==""){
                                  if (typeof LoadOnFly === "undefined"){
                                      include_file(ModuleCss, "css");
                                  } else {
                                      LoadOnFly("head", ModuleCss);
                                  }
                              }
                              if (ModuleJs!==""){
                                  include_file(ModuleJs, "js");
                              }
                          } catch(e) {
                           /* alert("An error has occurred: "+e.message)*/
                          }
                      -->
                      </script>
                      '
;
                }
            }
        }
    }
    return 
$_sFrontendCss.$content;

Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8924
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Lots of warnings in php_errorlog
« Reply #4 on: January 10, 2018, 11:09:26 PM »
You could also try to delete the droplet and then do a manually upgrade of the module droplets.
All missing WB droplets will installed (from the example folder).

An WB 2.10 upgrade will not replace old droplets with newer ones.
Logged
https://onkel-franky.de

johnbroeckaert

  • Guest
Re: Lots of warnings in php_errorlog
« Reply #5 on: January 11, 2018, 08:04:38 AM »
I tried the option of @Jacobi22 first. I works fine!
Thank YOU UWE.

Code: [Select]
global $database, $wb, $TEXT, $DGTEXT,$section_id,$page_id;
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.10.x) »
  • General Help & Support »
  • Lots of warnings in php_errorlog
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2