AnsweredAssumed Answered

require_once SubPanelTiles.php on _displaySubPanels() fails

Question asked by gperez gperez on Mar 17, 2014
Latest reply on Mar 17, 2014 by gperez gperez
I need to hide the "create" button for a couple of subpanels. So I do this (as I read somewhere in the forum)

function _displaySubPanels()    {
  require_once ('/include/SubPanel/SubPanelTiles.php'); 
  $subpanel = new SubPanelTiles($this->bean, $this->module);
  // remove Create buttons for Planet and Woocommerce payment modules
  unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['oasis_resersiswoocommerce']['top_buttons'][0]); 
  unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['ipay_ipay_os_reservations']['top_buttons'][0]); 

  echo $subpanel->display();
}
      This works fine in localhosts (In mine and in other developer's environment). However it crashes silently when uploaded to the testing server. No error in the logs, but the subpanels stopped appearing and also the footer. 

Things get better if I call: 
parent::_displaySubPanels();
Now the footer appears, but the subpanels are still missing. What's going on? 

I found that the problematic line is this: 
require_once ('/include/SubPanel/SubPanelTiles.php');    
Why including that file would cause problems?

Outcomes