# |
Feb 9th 2018, 15:10 |
kevin |
I put some stops in my app and it looks like the app never even gets into the if($this->request->is(‘post’)) statement. I checked my form and it is going to the right end point and the method is post. Im not sure why it wouldn’t get into that if statemetn |
# |
Feb 9th 2018, 15:09 |
kevin |
ok so I did find that I was doing entities incorrectly, and I believe I fixed that. I use the TableRegistry to pull the entity by ID, then I patch the entity with the request data |
# |
Feb 9th 2018, 15:03 |
kevin |
should I not be using Entities to update items in my DB? |
# |
Feb 9th 2018, 14:59 |
kevin |
I do have the Decklist entity in Model/Entity/Decklist.php |
# |
Feb 9th 2018, 14:58 |
kevin |
It just reloads the /edit/1 page again with no messages |
# |
Feb 9th 2018, 14:58 |
kevin |
I feel like im doing something super silly here. I cant get this form to save: https://pastebin.com/tiKnt9gR |
# |
Feb 9th 2018, 14:40 |
jkarlmen |
because right now once activated i get the error "Users is not associated with ModelName" if i modify the plugin directly it works but that is generally frowned upon |
# |
Feb 9th 2018, 14:39 |
jkarlmen |
I'd extend it but that would mostly apply it's properties to another model ... I'd like to mainly just apply table relations to the model the plugin is using |
# |
Feb 9th 2018, 14:38 |
jkarlmen |
If so is there a way of adding to that plugin's model without modifying the vendor files? |
# |
Feb 9th 2018, 14:38 |
jkarlmen |
so yet another question. Is it safe to assume that once loaded, the model of a plugin supersedes the model of a similarly name model in the app controller? |
# |
Feb 9th 2018, 14:36 |
dereuromark |
sugitime: I only had this when importing e.g. from csv, then I had to manually str_replace them back from \r to "\r". |
# |
Feb 9th 2018, 14:36 |
kevin |
it 100% does |
# |
Feb 9th 2018, 14:36 |
kevin |
exactly |
# |
Feb 9th 2018, 14:34 |
admad |
Then your data itself has \r\n as strings instead of actual new lines |
# |
Feb 9th 2018, 14:33 |
kevin |
I changed it to a text area and its still showing \r\n in the text area |
# |
Feb 9th 2018, 14:31 |
admad |
A textarea would show new lines as entered. |
# |
Feb 9th 2018, 14:29 |
kevin |
is there any way to make the form do that? |
# |
Feb 9th 2018, 14:29 |
kevin |
I have a form im working on; its an edit form. it one of the fields is $widget[0][‘details’]. this field has breaklines in the form of \r\n’s. when I $this->Form->create($widget), then $this->Form->control(‘details’), the form creates a textbox with a value of “this widget is used for stuff. stuff like\r\nfixing things\r\nbreaking things\r\ntesttest”. I’d prefer it actually parse the \r\n’s into breaklines. |
# |
Feb 9th 2018, 14:26 |
neon1024 |
I think 2 years is pretty safe :slightly_smiling_face: |
# |
Feb 9th 2018, 14:26 |
neon1024 |
https://github.com/cakephp/cakephp/blame/8ca5054ad237650dec85bc69377cb64a95f59f8f/src/Validation/Validator.php#L1594 |
# |
Feb 9th 2018, 14:26 |
admad |
You mean `@since`, sadly we weren't too particular about adding that tag |
# |
Feb 9th 2018, 14:25 |
neon1024 |
The code doesn’t have an `@from` docblock |
# |
Feb 9th 2018, 14:25 |
neon1024 |
I’d like to add the isInteger validation rule, but my minimum version of the plugin is 3.4.0 |
# |
Feb 9th 2018, 14:24 |
neon1024 |
How can I find out when a method was added? |
# |
Feb 9th 2018, 13:48 |
etipaced |
How do you sync them? Just a symlink? |
# |
Feb 9th 2018, 13:34 |
dereuromark |
I keep them in default root, but I sync them into webroot/assets |
# |
Feb 9th 2018, 13:07 |
etipaced |
Where is the best place to put the `node_modules` directory for a Cake 3 app? I’m new to using them and am unsure how to reference them from my templates if they are outside of `/webroot`. |
# |
Feb 9th 2018, 13:00 |
bravo-kernel |
@dereuromark happy cakebox camper? |
# |
Feb 9th 2018, 12:55 |
neon1024 |
Yeah, checking the entity in the controller after the patchEntity it’s still created a new entity. Even with setting $data to null in beforeMarshal. It’s even preserved the data, somehow.. |
# |
Feb 9th 2018, 12:53 |
neon1024 |
Be nice if there was afterMarshal, so I could check what’s happened |
# |
Feb 9th 2018, 12:52 |
neon1024 |
As I have this in my beforeMarshal, and I’d like to not even create an entity for it, and just skip |
# |
Feb 9th 2018, 12:51 |
neon1024 |
File uploaded https://cakesf.slack.com/files/U1BT622HW/F9638JVS5/requestdatadump_txt.txt / https://slack-files.com/T053DPNCM-F9638JVS5-3dfba40abe |
# |
Feb 9th 2018, 12:51 |
neon1024 |
Possibly, sorry I don’t know if there is an issue. Perhaps it’s the one that @seideng linked to yesterday :slightly_smiling_face: |
# |
Feb 9th 2018, 12:50 |
neon1024 |
..and I think beforeSave is too late, as the entity is already created |
# |
Feb 9th 2018, 12:50 |
dereuromark |
does that related to the open core ticket? |
# |
Feb 9th 2018, 12:50 |
neon1024 |
Setting `$data = null;` doesn’t seem to cut it though |
# |
Feb 9th 2018, 12:50 |
neon1024 |
Well this isn’t really just setting to null, as if the fields are empty I don’t want to create or save the entity at all |
# |
Feb 9th 2018, 12:49 |
dereuromark |
for me its a generic issue, not per model |
# |
Feb 9th 2018, 12:49 |
neon1024 |
This use-case is different, as it’s in a plugin |
# |
Feb 9th 2018, 12:49 |
dereuromark |
you dont necessarily need to - use it and be happy :slightly_smiling_face: it fixes the issue that the core has |
# |
Feb 9th 2018, 12:49 |
neon1024 |
I figured at the time, that it would be easier to drop in a quick few lines into my existing beforeMarshal |