Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update include/SubPanel/SubPanelDefinitions.php #129

Open
wants to merge 1 commit into from

1 participant

@ghost

Found yesterday that was was possible for the include_once in line 499 to try and load
an empty $bean_name if $bean_name is not set correctly or there is an error with the sub panel
definitions. 

ipejanet Update include/SubPanel/SubPanelDefinitions.php
Found yesterday that was was possible for the include_once in line 499 to try and load
an empty $bean_name if $bean_name is not set correctly or there is an error with the sub panel
definitions. 
2df6fdb
@jmertic jmertic commented on the diff
include/SubPanel/SubPanelDefinitions.php
((7 lines not shown))
- include_once ($beanFiles [ $bean_name ]) ;
- $this->template_instance = new $bean_name ( ) ;
- $this->template_instance->force_load_details = true ;
- $this->table_name = $this->template_instance->table_name ;
- //$this->db_fields=$this->template_instance->column_fields;
+
+ if (! empty ($bean_name)) {
+
+ $this->bean_name = $bean_name ;
+
+ include_once ($beanFiles [ $bean_name ]) ;
+ $this->template_instance = new $bean_name ( ) ;
+ $this->template_instance->force_load_details = true ;
+ $this->table_name = $this->template_instance->table_name ;
+ //$this->db_fields=$this->template_instance->column_fields;
+ }
}
}
@jmertic
jmertic added a note

Just out of curiosity, if $bean_name is not set, I'm assuming the the sub panel won't either. Wondering if we should put something in the error log here to help people debug this fact.

@ghost
ghost added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jmertic

This looks great, and I should be able to pull this in. Two minor things I need from you...

@jmertic

Hi ipejanet!

Wanted to check back if you could get a bug and contribution agreement done for this pull request. We cannot pull in the fix without one.

Thanks!

John Mertic
Sugar Community Manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2012
  1. Update include/SubPanel/SubPanelDefinitions.php

    ipejanet authored
    Found yesterday that was was possible for the include_once in line 499 to try and load
    an empty $bean_name if $bean_name is not set correctly or there is an error with the sub panel
    definitions. 
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 8 deletions.
  1. +11 −8 include/SubPanel/SubPanelDefinitions.php
View
19 include/SubPanel/SubPanelDefinitions.php
@@ -491,14 +491,17 @@ function load_module_info ()
{
$bean_name = $beanList [ $this->get_module_name () ] ;
-
- $this->bean_name = $bean_name ;
-
- include_once ($beanFiles [ $bean_name ]) ;
- $this->template_instance = new $bean_name ( ) ;
- $this->template_instance->force_load_details = true ;
- $this->table_name = $this->template_instance->table_name ;
- //$this->db_fields=$this->template_instance->column_fields;
+
+ if (! empty ($bean_name)) {
+
+ $this->bean_name = $bean_name ;
+
+ include_once ($beanFiles [ $bean_name ]) ;
+ $this->template_instance = new $bean_name ( ) ;
+ $this->template_instance->force_load_details = true ;
+ $this->table_name = $this->template_instance->table_name ;
+ //$this->db_fields=$this->template_instance->column_fields;
+ }
}
}
@jmertic
jmertic added a note

Just out of curiosity, if $bean_name is not set, I'm assuming the the sub panel won't either. Wondering if we should put something in the error log here to help people debug this fact.

@ghost
ghost added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
//this function is to be used only with sub-panels that are based
Something went wrong with that request. Please try again.