⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Problem with dropdown



elfuego1

elfuego1
  • profile picture
  • Member

Posted 12 February 2013 - 19:52 PM

Hi,

 

I wanted to use dropdown, but when I add this code:

$crud->field_type('my_field','dropdown', array('1' => 'active', '2' => 'private','3' => 'spam' , '4' => 'deleted'));
 


these 2 errors show up on the list page:

 

Severity: Notice

Message: Undefined property: stdClass::$extras

Filename: libraries/grocery_crud.php

Line Number: 291

 

Severity: Warning

Message: array_key_exists() expects parameter 2 to be array, null given

Filename: libraries/grocery_crud.php

Line Number: 291

 

I get this errors on CI rev. 2.0.3 and 2.1.3.

 

Can you help me with this?


tlc033

tlc033
  • profile picture
  • Member

Posted 12 February 2013 - 20:42 PM

What version of GC do you use ?


elfuego1

elfuego1
  • profile picture
  • Member

Posted 12 February 2013 - 21:17 PM

Latest.

In library file "grocery_crud.php" it sais:

@version        1.3


tlc033

tlc033
  • profile picture
  • Member

Posted 12 February 2013 - 21:46 PM

For my work OK, possible error is elsewhere.

 

Show you controller function, can anyone find the error.


elfuego1

elfuego1
  • profile picture
  • Member

Posted 12 February 2013 - 22:53 PM

Problem solved!

 

Your suggestion that it's not the incompatibility of CI and GC rev. gave me an idea.

In my controller I was trying to apply field_type method to field from table I joined in my model.

I found a workarround for THAT.

Fortunately I have a field in main table that I can use instead.

 

Thanks for your help.