Jump to content


I can not use fields() and unset_edit_fields() simultaneously

bug

  • Please log in to reply
1 reply to this topic

#1 shum

shum

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationRussia, Moscow

Posted 08 October 2012 - 02:13 PM

In fields:

public function fields()
{
$args = func_get_args();

if(isset($args[0]) && is_array($args[0]))
{
$args = $args[0];
}

$this->add_fields = $args;
$this->edit_fields = $args; //!!!!!!!!!!!!

return $this;
}

In unset_edit_fields:
protected function get_edit_fields()
{
if($this->edit_fields_checked === false)
{
$field_types = $this->get_field_types();
if(!empty($this->edit_fields)) //!!!!!!!!!!!
{
/*
.....
*/
}
else
{
/*
If i used fields() $this->edit_fields not empty! FAIL!
*/

$this->edit_fields = array();
foreach($field_types as $field)
{
//Check if an unset_edit_field is initialize for this field name
if($this->unset_edit_fields !== null && is_array($this->unset_edit_fields) && in_array($field->name,$this->unset_edit_fields))
continue;
/*
.....
*/

*/
}

$this->edit_fields_checked = true;
}
return $this->edit_fields;
}

I do not speak English, sorry :(


#2 shum

shum

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationRussia, Moscow

Posted 08 October 2012 - 03:39 PM

I'm sorry, I thought unset_edit_fields = "set_field_readonly"
The question is closed

I do not speak English, sorry :(






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users