# |
Jan 21st 2020, 18:31 |
jotpe |
@ricksaccous This works: `<?= $this->Form->control('items', ['multiple' => 'checkbox', 'options' => $optionalItems, '*value*' => $selected]) ?>` |
# |
Jan 21st 2020, 18:30 |
jotpe |
I set the Items in my Controller then manually |
# |
Jan 21st 2020, 18:30 |
jotpe |
This is unfortunately not an option. I need to seperate the Items into RequiredItems/OptionalItems. I don't want the RequiredItems as Checkboxes |
# |
Jan 21st 2020, 18:29 |
ricksaccous |
is this some sort of custom structure that isn't being saved but acted upon? |
# |
Jan 21st 2020, 18:28 |
ricksaccous |
@jotpe why wouldn't your entity be able to tell which ones are selected? |
# |
Jan 21st 2020, 18:23 |
slackebot |
<jotpe> |
# |
Jan 21st 2020, 18:22 |
jotpe |
My Options look like this: |
# |
Jan 21st 2020, 18:21 |
jotpe |
This is the control: `<?= $this->Form->control('items', ['multiple' => 'checkbox', 'options' => $optionalItems, 'selected' => $selected]) ?>` |
# |
Jan 21st 2020, 18:21 |
jotpe |
I have a control for multiple checkboxes, but I can't set the selected Items. How can I select the checkboxes? |
# |
Jan 21st 2020, 17:58 |
ricksaccous |
it happens to the best of us |
# |
Jan 21st 2020, 17:58 |
ricksaccous |
that's no problem |
# |
Jan 21st 2020, 17:54 |
carl65 |
I finally found the mistake I made an I'm so sorry, I bothered you with this. It was simply a typo in the form, having "group_id" in edit.ctp and "group" in add.ctp. Hence the new user did not belong to a group and was not allowed to log in. Sooooo sorry. |
# |
Jan 21st 2020, 16:52 |
ricksaccous |
@javier.villanueva that works |
# |
Jan 21st 2020, 16:52 |
ricksaccous |
to modify it for this one field, thanks |
# |
Jan 21st 2020, 16:52 |
ricksaccous |
yeah i just listended for the query params |
# |
Jan 21st 2020, 16:23 |
javier.villanueva |
in this case |
# |
Jan 21st 2020, 16:23 |
javier.villanueva |
and use DESC instead ASC |
# |
Jan 21st 2020, 16:21 |
ricksaccous |
@javier.villanueva will try that |
# |
Jan 21st 2020, 16:20 |
javier.villanueva |
@ricksaccous try with minus (-) before field name |
# |
Jan 21st 2020, 16:16 |
ndm |
@dsar Please show what exactly you're doing code wise |
# |
Jan 21st 2020, 16:07 |
ricksaccous |
is there a way to work with pagination in order to accomplish this |
# |
Jan 21st 2020, 16:07 |
ricksaccous |
suppose i want to order a single paginated field differently (that cake sorts by default via Field => 'ASC'), I basically do not want null values to take precedence in this case |
# |
Jan 21st 2020, 15:42 |
dsar |
It only shows its initial value |
# |
Jan 21st 2020, 15:39 |
ndm |
You should probably show what you specifically are doing... the form helper should be able to pick up any entity property, no matter how it was added |
# |
Jan 21st 2020, 15:24 |
dsar |
This guy has the same problem |
# |
Jan 21st 2020, 15:24 |
dsar |
https://discourse.cakephp.org/t/3-4-cannot-display-a-virtual-field-in-a-form/2621 |
# |
Jan 21st 2020, 15:23 |
royalty |
and i think it should appear in the form if you have it set properly |
# |
Jan 21st 2020, 15:22 |
royalty |
what would you want to use it for? |
# |
Jan 21st 2020, 15:22 |
dsar |
Is it an expected behavior? |
# |
Jan 21st 2020, 15:22 |
dsar |
Uhm, it seems that I can't use a virtualfield in the form |
# |
Jan 21st 2020, 14:48 |
royalty |
yeah the component is fine for cakephp3 |
# |
Jan 21st 2020, 14:47 |
carl65 |
Still, the component should work, shouldn't it? |
# |
Jan 21st 2020, 14:47 |
carl65 |
And yes, I am using the Auth component - will check out the plugin, too. |
# |
Jan 21st 2020, 14:46 |
carl65 |
Thank you very much for your replies, I will check that tomorrow and let you know. |
# |
Jan 21st 2020, 14:44 |
ndm |
Are you sure they are stored correctly in the database when adding? And as @ricksaccous suggested, check what exactly happens at the login, check the SQL queries in debug kit, and maybe even debug the form authenticator to see what it retrieves. |
# |
Jan 21st 2020, 14:44 |
royalty |
carl65, i'm assuming you aren't using the new Authentication plugin but are using the authentication component? |
# |
Jan 21st 2020, 14:42 |
ndm |
``` $defaultHasher = new DefaultPasswordHasher(); debug($defaultHasher->check('test1234!', '$2y$10$sg97/JCi5SwdkoaWfBQ9guzU1aZIftmcMdXLl7uHC/s75Y6lsYxJG')); debug($defaultHasher->check('test1234!', '$2y$10$tPHuaMDFidXSMeQLwilJK.qGC4.qkC06gHrKmzV.ickhjkpBbqFBq'));``` |
# |
Jan 21st 2020, 14:42 |
ricksaccous |
you should debug the login result |
# |
Jan 21st 2020, 14:42 |
ndm |
Checking the passwords against the `test1234!` string, both come back as matching for me. |
# |
Jan 21st 2020, 14:38 |
carl65 |
Updated CakePHP to 3.8.8. meanwhile - still the same problem. |
# |
Jan 21st 2020, 14:37 |
carl65 |
Hey, this worked. |