21492 Posts in 5783 Topics by 2621 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 227 Views |
-
Trouble managing Many Many on Member [RESOLVED]

30 March 2012 at 5:01pm
Hi guys,
I'm having some trouble managing a many_many relationship on the Member class.
So, I've created a decorator that appends Member with project developments. Like this
class ClientDecorator extends DataObjectDecorator
{
function extraStatics() {
return array(
'many_many' => array(
'Developments' => 'Development'
)
);
}
public function updateCMSFields(FieldSet $fields) {
$fields->addFieldToTab('Root.Members', new CheckboxField('RedirectToConveyancing', 'Redirect to Conveyancing on Login'));
$devs = DataObject::get('Development')->map('ID','Name');
$devfield = new ManyManyComplexTableField(
$this->owner,
'Developments',
'Development',
array(
'Name' => 'Name'
),
'getCMSFields_forPopup'
);
$fields->addFieldToTab('Root.Developments', $devfield);
}
}When I edit a Member under Security in the admin, the box shows and lists the developments, complete with those assigned to the member, but when I change the developments assigned to the member and save, it doesn't store the changes. Am I doing something wrong?
Thanks,
Lee -
Re: Trouble managing Many Many on Member [RESOLVED]

5 April 2012 at 10:59am
Anyone? It's still an issue and I can't find how to resolve it.
Thanks.
-
Re: Trouble managing Many Many on Member [RESOLVED]

5 April 2012 at 11:18am
No idea, but my advice would be to find a module like member profiles that might do something similar and copy that.
-
Re: Trouble managing Many Many on Member [RESOLVED]

5 April 2012 at 11:58am
Thanks Swaiba.
I've actually figured it out
turns out to the the whole "ManyManyComplexTableField not saving in a popup" bug. I fixed it by adding some code to a onBeforeWrite handler.
Thanks again.
Lee
| 227 Views | ||
|
Page:
1
|
Go to Top |


