⚠ 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

Empty primary_key



Portek
  • profile picture
  • Member

Posted 11 July 2013 - 12:08 PM

Hello, i have strange issue with lib. I try to setup 2 crud tables in one controller, but something went wrong. Script reported error:

[php]Fatal error: Cannot access empty property in application\libraries\grocery_crud.php on line 1451[/php]

 

[php]        foreach($data->list as $num_row => $row)
        {           
            $data->list[$num_row]->edit_url = $data->edit_url.'/'.$row->{$data->primary_key};
            $data->list[$num_row]->delete_url = $data->delete_url.'/'.$row->{$data->primary_key};
        }

[/php]

 

Here's my code, what i do wrong?

 

When i print all object ($row) it show only this, where disappeared secound object?

[php]stdClass Object ( [pet_id] => 1 [mating] => 123 [childbirth] => 123 [heat_date] => 123 [childrens] => 123 [s20c984a4] => Pies1 - Pies1 - 123456789 ) 

[/php]

 

Ps. Sorry for my english :-)


davidoster
  • profile picture
  • Member

Posted 11 July 2013 - 13:43 PM

Hello [member=potek] and welcome to the forums.

There is known issue about using GC under public index function.

This is documented here: http://www.grocerycrud.com/documentation/known-issues (last bullet point)


Portek
  • profile picture
  • Member

Posted 16 July 2013 - 14:23 PM

Ok, i moved content to another function but i still have same issue. I clicked "More" in pets controller, and i'm moved to controller more, and dogs function, then i see same error.

 


davidoster
  • profile picture
  • Member

Posted 16 July 2013 - 23:00 PM

Can you explain again what the error is?