Log message #4116321

# At Username Text
# Feb 11th 2018, 04:51 ricksaccous each option should be
# Feb 11th 2018, 04:51 ricksaccous depends how you have your form set up
# Feb 11th 2018, 04:51 humbba12 like in function new ?
# Feb 11th 2018, 04:51 humbba12 but it is gonna work with getting from post
# Feb 11th 2018, 04:51 ricksaccous sheeeeeet
# Feb 11th 2018, 04:51 ricksaccous yeah those array structures always need to be precise
# Feb 11th 2018, 04:51 humbba12 It worked :)
# Feb 11th 2018, 04:50 ricksaccous ;)
# Feb 11th 2018, 04:49 ricksaccous what you have now is just 'options' => ['name' => 'dude'] which is wrong
# Feb 11th 2018, 04:49 ricksaccous that's how it should be
# Feb 11th 2018, 04:49 ricksaccous 'options' => [ ['name' => 'wow']]
# Feb 11th 2018, 04:49 ricksaccous in the data
# Feb 11th 2018, 04:48 ricksaccous you have that set up wrong
# Feb 11th 2018, 04:48 ricksaccous options has to be an array of arrays
# Feb 11th 2018, 04:48 ricksaccous wait a minute
# Feb 11th 2018, 04:47 ricksaccous $item = $this->Items->patchEntity($item, $data,[ 'associated' => ['Groups.Options']]);
# Feb 11th 2018, 04:47 ricksaccous try using dot notation here instead
# Feb 11th 2018, 04:44 ricksaccous hmmm
# Feb 11th 2018, 04:44 ricksaccous oh
# Feb 11th 2018, 04:43 slackebot1 $this->Items->save($item); debug($item); }
# Feb 11th 2018, 04:43 slackebot1 'available' => 1]] ] ]; $item = $this->Items->newEntity(); $item = $this->Items->patchEntity($item, $data,[ 'associated' => ['Groups'=> ['associated'=> ['Options']]]]); //debug($item); debug($this->request->getData()); /*$item->groups = []; $item->groups[] = ['name' => 'color', 'required' => 1, 'type' => 'checkbox']; $item->dirty('groups', true);*/
# Feb 11th 2018, 04:43 humbba12 public function new1() { $data = [ 'sku' => 'd489rfsdf4rfdfsdf3', 'name' => 'blusa', 'price' => 10, 'unit' => 'pieza', 'groups' => [ ['name' => 'color', 'required' => 1, 'type' => 'checkbox', 'options' => ['name' => 'verde', 'value' => 10.2,
# Feb 11th 2018, 04:43 ricksaccous lol
# Feb 11th 2018, 04:43 ricksaccous wat
# Feb 11th 2018, 04:43 humbba12 just []
# Feb 11th 2018, 04:43 humbba12 its empty
# Feb 11th 2018, 04:43 ricksaccous the debug($this->request->getData());
# Feb 11th 2018, 04:43 ricksaccous $this->request->getData()
# Feb 11th 2018, 04:43 ricksaccous now let me see this
# Feb 11th 2018, 04:42 humbba12 File uploaded https://cakesf.slack.com/files/U6DMU08AE/F9849DZU6/-.php / https://slack-files.com/T053DPNCM-F9849DZU6-96ccb5a4dd - now with options in the array
# Feb 11th 2018, 04:42 humbba12 I see
# Feb 11th 2018, 04:41 ricksaccous you see?
# Feb 11th 2018, 04:40 ricksaccous oops
# Feb 11th 2018, 04:40 ricksaccous protected $_accessible = [ 'name' => true, 'required' => true, 'description' => true, 'type' => true, 'order' => true, 'item_id' => true, 'item' => true, 'groups_options' => true, 'orders_details' => true, ];
# Feb 11th 2018, 04:39 ricksaccous to that array
# Feb 11th 2018, 04:39 ricksaccous you need to add options
# Feb 11th 2018, 04:39 slackebot1 => true, 'required' => true, 'description' => true, 'type' => true, 'order' => true, 'item_id' => true, 'item' => true, 'groups_options' => true, 'orders_details' => true ]; }
# Feb 11th 2018, 04:39 humbba12 class Group extends Entity { /** * Fields that can be mass assigned using newEntity() or patchEntity(). * * Note that when '*' is set to true, this allows all unspecified fields to * be mass assigned. For security purposes, it is advised to set '*' to false * (or remove it), and explicitly make individual fields accessible as needed. * * @var array */ protected $_accessible = [ 'name'
# Feb 11th 2018, 04:39 ricksaccous Entity/Group.php
# Feb 11th 2018, 04:38 ricksaccous you should do that
# Feb 11th 2018, 04:38 ricksaccous also did you make options accessible in your groups entity?