⚠ 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

relation_n_n



John Ophof
  • profile picture
  • Member

Posted 11 February 2015 - 09:33 AM

My code is like this 2 primary tables:

business_role and user_story with both PK AI keys named busines_roleID and user_storyID
An intersection table user_story_business_role containing 2 fields busines_roleID and user_storyID

in the middle:

 

The code in business_role template

$crud->set_relation_n_n('bla', 'user_story_business_role', 'user_story', 'business_roleID', 'user_storyID', 'name');

name is a varchar field in user_story.

'bla' is in my field list

It throws this message at the business role page:

A PHP Error was encountered

Severity: Warning

Message: Creating default object from empty value

Filename: libraries/Grocery_CRUD.php

Line Number: 1106

Backtrace:

File: /Volumes/WDMobile/htdocs/ezbuild30/application/ezbuild/libraries/Grocery_CRUD.php
Line: 1106
Function: _error_handler

File: /Volumes/WDMobile/htdocs/ezbuild30/application/ezbuild/libraries/Grocery_CRUD.php
Line: 1543
Function: get_edit_values

File: /Volumes/WDMobile/htdocs/ezbuild30/application/ezbuild/libraries/Grocery_CRUD.php
Line: 3964
Function: showEditForm

File: /Volumes/WDMobile/htdocs/ezbuild30/application/ezbuild/controllers/Business_role.php
Line: 392
Function: render

File: /Volumes/WDMobile/htdocs/ezbuild30/ezbuild.php
Line: 271
Function: require_once

The same code on the user_story page here no error message but I miss the options add all records as shown in the examples. I can select multiple items but remove all add all records is missing.

 

The code in the user_story template is this one:

    $crud->set_relation_n_n('n:m', 'user_story_business_role', 'business_role', 'user_storyID', 'business_roleID', '{name}');
 

name is a field in business_role.

Big Thanks!

 


John Ophof
  • profile picture
  • Member

Posted 11 February 2015 - 16:17 PM

The error message faded away somehow.

I am still puzzling how to get the option show all or delete all.

In the dialogue I can only add items 1 at a time.

 

John