Logs for #cakephp

Page 8 of 34,879, showing 100 records out of 3,487,833 total, starting on record 701, ending on 800

# At Username Text
# May 25th, 20:30 inoas so that you can write the string as a twig file
# May 25th, 20:30 inoas it should probably also be able to take an identifier
# May 25th, 20:30 inoas WyriHaximus: well that's what I am doing at the moment...
# May 25th, 20:29 jeremyharris meder_ try running `$this->Attachments->newEntity($attachment)` on one of your attachments to see what it produces
# May 25th, 20:29 WyriHaximus Using twig templates instead of PHP templates in all my projects. I'm also looking into making a filter or a function that takes a string and renders a twig template.
# May 25th, 20:29 jeremyharris this tells me that you have no Result entity (which is okay, it uses the default) and it is not patching the attachments array into entities https://gist.github.com/anonymous/70f9f90f2830ecf9614cc4f2a3cf6f28#file-entities-php-L14
# May 25th, 20:28 jeremyharris also remove result_id, that should be automatically set on save
# May 25th, 20:28 meder_ ok
# May 25th, 20:28 jeremyharris for one
# May 25th, 20:28 jeremyharris remove the id
# May 25th, 20:27 meder_ sorry
# May 25th, 20:27 meder_ lot of file upload stuff there, but i think the issue is the id is blank as you said
# May 25th, 20:27 jeremyharris yeah I’m just getting confused by the differences
# May 25th, 20:27 meder_ i know it's recommended to paste the real code but honestly there was a crap ton of stuff i had to chop off.
# May 25th, 20:27 meder_ yes
# May 25th, 20:27 jeremyharris meder_ your Attachments table is in a plugin called Results, right?
# May 25th, 20:27 inoas but we cannot allow the "design agencies" that work with us to get access to the source code in any way... and we need revisions and translation, so we do it through the database
# May 25th, 20:26 inoas do you actually use TwigView to write twig template files instead of php ones within projects? cause it looked to me like that was its golden use case
# May 25th, 20:25 jeremyharris meder_ $attachments contains keys that your gist doesn’t even set
# May 25th, 20:25 inoas plugin_type_uuid_revision-uuid.twig
# May 25th, 20:25 inoas cause my twig files come from the database and look like FlexiCms_document_76ad7ef8_863b_456b_9490_c63d6ce0657a_76ad7ef8_863b_456b_9490_c63d6ce0657a.twig
# May 25th, 20:25 meder_ hm the id is blank yeah
# May 25th, 20:25 inoas I am not sure... I really would want to have twig template loading... like loading from a base template - but that won't be so easy
# May 25th, 20:24 WyriHaximus Yeah TwigView is designed to cover a lot more cases :)
# May 25th, 20:24 meder_ https://gist.github.com/anonymous/70f9f90f2830ecf9614cc4f2a3cf6f28 jeremyharris
# May 25th, 20:23 inoas I am just reusing the idea how to get helpers loaded <3 and the extensions :)
# May 25th, 20:23 inoas TwigView does a lot more
# May 25th, 20:23 inoas so I do not need to catch all kind of cases
# May 25th, 20:23 inoas well at least my stuff is tightly integrated
# May 25th, 20:22 WyriHaximus Aye, and if it doesn't, adept and release a new (major) verison
# May 25th, 20:21 inoas go the long run ;p?
# May 25th, 20:21 WyriHaximus inoas: awesome sounds great :D, only one way to find out how it works out in the long run ;)
# May 25th, 20:20 jeremyharris meder_ I think you are misusing $id there, as it is setting the id of the attachment. you should leave it empty so it is automatically associated with Results
# May 25th, 20:19 meder_ ok sec
# May 25th, 20:19 inoas but I am still unsure if the way I do things is good in the long run
# May 25th, 20:19 jeremyharris yes
# May 25th, 20:19 meder_ jeremyharris: $attachments is line 20, its not an entity its just a raw php array with the ids/fields
# May 25th, 20:19 inoas like say {{ Html.css('/assets/vendor/node_modules/marx-css/css/marx.min.css')|raw }}
# May 25th, 20:19 inoas and I could reuse all the nice extensions you build :)
# May 25th, 20:18 jeremyharris meder_ can you please gist $attachments at that point, as well as $patchedEntity
# May 25th, 20:18 inoas so all that's nice...
# May 25th, 20:18 inoas and the twig templates that reside in my database are already written as twig files, then again cached by twig loader
# May 25th, 20:18 meder_ eg $entity['attachments'] = array_merge ( $entity['attachments'], $attachments );
# May 25th, 20:18 meder_ do I just need to "patch" $entity['attachments'] with line 25?
# May 25th, 20:18 inoas WyriHaximus: I can already use helpers, and extensions that you supply
# May 25th, 20:18 jeremyharris so that’s why using ‘associated’ showed no difference
# May 25th, 20:18 meder_ ok
# May 25th, 20:17 jeremyharris first level associations are patched by default
# May 25th, 20:17 meder_ i actually just found it's not using the associated table in the 'associated' call, weird
# May 25th, 20:17 meder_ jeremyharris: it has a ton of internal stuff, i pretty much replicated it there
# May 25th, 20:17 inoas and every element can have its own twig template
# May 25th, 20:16 meder_ https://gist.github.com/anonymous/36f6b41353aceaacbb7b01a653418ab0
# May 25th, 20:16 inoas basically m document consist of multiple (translatable) elements, and each can be a module => small xml snipplet... which then fires a cakephp cell in the background
# May 25th, 20:15 inoas I will have something that maps to cells...
# May 25th, 20:15 inoas this is how I proceed now
# May 25th, 20:15 inoas https://gist.github.com/inoas/649a921179fbd160d80c4fc2bfd70876#gistcomment-2106583
# May 25th, 20:13 inoas aka I leave elements, cells, layout as it is cause I am replacing the whole layout with whatever comes from the database (cached as files)
# May 25th, 20:13 WyriHaximus inoas: seen your previous message but you where online when I wanted to reply
# May 25th, 20:13 inoas WyriHaximus: if you are reading this: I made my own SimpleTwigView which overwrides render instead of _render and has a renderTwigTemplate() which does the loadTemplate()->render() call
# May 25th, 19:58 jeremyharris and the entity you pass to save() — the result of patchEntity
# May 25th, 19:58 jeremyharris can you gist the actual newEntity / patching process
# May 25th, 19:58 meder_ this is before
# May 25th, 19:58 jeremyharris ok, is this the entity before or after it is patched?
# May 25th, 19:58 meder_ array merge perhaps
# May 25th, 19:57 meder_ jeremyharris: yeah i wasn't setting it in the entity itself, attachments field. just manually override it? what about appending incase it exists?
# May 25th, 19:57 jeremyharris and then your change wouldn’t have to go into trying a full path, since it’s what would be suggested :slightly_smiling_face:
# May 25th, 19:57 meder_ https://gist.github.com/anonymous/0f5a0c3467764f4bd14fb84ea30fe149
# May 25th, 19:57 jeremyharris yes, that’s what I was thinking
# May 25th, 19:57 chris-andre Right, in the original docs. You want `/full/path/to/root/bin/cake myshell myparam`
# May 25th, 19:56 jeremyharris and then just use the full path in the example, and your change can omit the bit about it since it will be the example
# May 25th, 19:56 jeremyharris right, what I’m saying is we should drop even suggesting cd /path/to andand bin/cake myShell
# May 25th, 19:55 chris-andre In my example, I have the full path as example.
# May 25th, 19:55 jeremyharris nm I’m being lazy, yes it does :slightly_smiling_face: so yeah I would still suggest always using a full path
# May 25th, 19:54 jeremyharris does `php /full/path/to/bin/cake` show the proper paths to your app and cake core?
# May 25th, 19:53 chris-andre Ill comment on GH
# May 25th, 19:53 jeremyharris although nm, that probably won’t work
# May 25th, 19:52 jeremyharris e.g., change the example to the /full/path/to/bin/cake and remove the bit you added about trying the full path
# May 25th, 19:51 jeremyharris @chris-andre probably should be discussed on GH; my point was I don’t think we should even concern ourselves with the bit about CDing into the dir and running the shell like that, and use fully qualified paths instead (even in the existing example)
# May 25th, 19:51 jeremyharris gist your code and I’ll explain
# May 25th, 19:50 jeremyharris the first argument is usually an empty or existing entity you find with get/first
# May 25th, 19:50 jeremyharris meder_ patchEntity returns an entity, which is what you in turn pass to save(). what’s the debug output of that entity
# May 25th, 19:50 meder_ the item i passed, the first argument, no it doesnt have it
# May 25th, 19:49 chris-andre @jeremyharris I saw your comment on my PR. What do you mean by recommending `cd andand bin/cake`? Were you thinking about the paragraph I added? (tell me if you want to keep the conversation on github)
# May 25th, 19:49 meder_ the debug of ->patchEntity?
# May 25th, 19:49 jeremyharris the item you passed to save
# May 25th, 19:49 jeremyharris but what about the result?
# May 25th, 19:49 meder_ but at some point this apparently worked
# May 25th, 19:48 meder_ not the first
# May 25th, 19:48 meder_ the second parameter, request data does
# May 25th, 19:47 jeremyharris does the patched entity contain the hasMany entities within it?
# May 25th, 19:47 meder_ how can I debug a patchEntity call where the associated data isn't being inserted into a hasMany table, even though 'associated' specifies that?
# May 25th, 19:04 steinkel @igreat just in case you are still playing around, here is a full example extending the controller and creating a custom register action > https://ide.c9.io/steinkel/users-34-extended-controller
# May 25th, 18:45 atomCode yep, thanks!
# May 25th, 18:45 jeremyharris yeah, that’s what saveMany does anyway. wrap it in a transaction and you should be good
# May 25th, 18:44 atomCode I guess the only way is to iterate through each record and do a saveAssociated
# May 25th, 18:39 jeremyharris hm maybe not sorry. been a long time
# May 25th, 18:37 jeremyharris I think comment would go under the Article key?
# May 25th, 18:36 atomCode I've looked a the docs and that data structure doesn't seem to be supported with a saveMany nor a saveAll call
# May 25th, 18:35 atomCode Is it not possible to saveMany data of a model along with many associated Model data on Cake 2.x like this https://gist.github.com/atomCode/f7d0163aaf8b439d7413244f5ed6caf5#file-gistfile1-txt ?
# May 25th, 18:26 temp1029 :-)