# |
Jul 18th 2018, 15:18 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBSKJ75MH/image.png / https://slack-files.com/T053DPNCM-FBSKJ75MH-d26bdd617e - this is appview.php from the main project |
# |
Jul 18th 2018, 15:18 |
josbeir |
:) |
# |
Jul 18th 2018, 15:18 |
josbeir |
too much @dereuromark ecosphere already. |
# |
Jul 18th 2018, 15:17 |
dereuromark |
maybe you should have used the local sandbox for a test run :P less issues |
# |
Jul 18th 2018, 15:17 |
flavius |
the way i did it was like this |
# |
Jul 18th 2018, 15:17 |
dereuromark |
easy to fix then, yeah. for now it can be in $helpers in controllers |
# |
Jul 18th 2018, 15:17 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBSG8LUCC/image.png / https://slack-files.com/T053DPNCM-FBSG8LUCC-3a96800596 - there's also this that <@UAG1HNWKT> mentioned |
# |
Jul 18th 2018, 15:16 |
dereuromark |
lets make testing great again |
# |
Jul 18th 2018, 15:15 |
josbeir |
yeah saw that one too, i didn't agree so no mention :) |
# |
Jul 18th 2018, 15:15 |
flavius |
point stands, i have one fine body at least :P |
# |
Jul 18th 2018, 15:14 |
dereuromark |
agreed |
# |
Jul 18th 2018, 15:14 |
josbeir |
i think a proper default theme would be the best aproach for this plugin |
# |
Jul 18th 2018, 15:14 |
dereuromark |
bundling frontend and assets into php stuff is not that easy |
# |
Jul 18th 2018, 15:14 |
dereuromark |
sry, did only test with the apps that seem to have those built in |
# |
Jul 18th 2018, 15:13 |
dereuromark |
yeah I guess those are pulled in the main layout assets. |
# |
Jul 18th 2018, 15:13 |
flavius |
well you didn't include any of that in your plugin |
# |
Jul 18th 2018, 15:12 |
dereuromark |
seems also to miss some styling for the overlay window that runs the ajax for executing the test and displaying result |
# |
Jul 18th 2018, 15:11 |
flavius |
File uploaded https://cakesf.slack.com/files/U75U0UMR9/FBSKC7W75/image.png / https://slack-files.com/T053DPNCM-FBSKC7W75-af970fb2e0 - <@U052SF4V6> not really sure how this is supposed to work |
# |
Jul 18th 2018, 14:58 |
josbeir |
so best do do it below after the save stuff |
# |
Jul 18th 2018, 14:58 |
josbeir |
yep but rules not |
# |
Jul 18th 2018, 14:57 |
neon1024 |
Entity errors will be present after patchEntity ;) |
# |
Jul 18th 2018, 14:56 |
josbeir |
also check the Email entity's $accessible array if all fields you want to save are defined there (if the property is present) |
# |
Jul 18th 2018, 14:55 |
josbeir |
see whats inside that array |
# |
Jul 18th 2018, 14:55 |
josbeir |
and save |
# |
Jul 18th 2018, 14:55 |
josbeir |
do a $email->getErrors(); |
# |
Jul 18th 2018, 14:55 |
mr.mjsm |
$email = $this->Emails->patchEntity($email, ['email' => $this->request->getData('email'), 'is_primary' => 'true', 'company_id' => $company->company_id ]); |
# |
Jul 18th 2018, 14:55 |
mr.mjsm |
i am thinking my assignment here is wrong |
# |
Jul 18th 2018, 14:55 |
josbeir |
above the $this->set below |
# |
Jul 18th 2018, 14:54 |
josbeir |
validation and/or rules are probably failing |
# |
Jul 18th 2018, 14:54 |
mr.mjsm |
$this->Emails->save($email) results in FALSE |
# |
Jul 18th 2018, 14:54 |
mr.mjsm |
the saving part |
# |
Jul 18th 2018, 14:54 |
josbeir |
then what does not work ? |
# |
Jul 18th 2018, 14:54 |
mr.mjsm |
it does exit, this $query = $this->Emails->find('all', ['conditions' => ['Emails.email' => $this->request->getData('email')]]); works just fine |
# |
Jul 18th 2018, 14:53 |
josbeir |
and make sure EmailsTable exists |
# |
Jul 18th 2018, 14:53 |
mr.mjsm |
nope. |
# |
Jul 18th 2018, 14:52 |
josbeir |
did you do $this->loadModel('Emails') in your controller initialize() |
# |
Jul 18th 2018, 14:51 |
flavius |
+1 for that jquery dependency, just noticed it now |
# |
Jul 18th 2018, 14:51 |
mr.mjsm |
did it, still same problem ;( |
# |
Jul 18th 2018, 14:51 |
josbeir |
also, maybe read up on cakephp basics, and php's compact function first :) |
# |
Jul 18th 2018, 14:50 |
josbeir |
$this->set(compact('company', 'email')); |
# |
Jul 18th 2018, 14:50 |
josbeir |
add 'email' to the compact() function too |