Logs for #cakephp

Page 1 of 36,355, showing 100 records out of 3,635,468 total, starting on record 1, ending on 100

# At Username Text
# Today, 14:16 dev.cyrusjayson got it
# Today, 14:10 dereuromark need to refactor IdeHelper to support all those new ide directives, pretty neat to have (method) argument autocomplete working now.
# Today, 14:09 dereuromark whuz up
# Today, 13:56 neon1024 No idea I’m afraid, I’ve never needed to use that
# Today, 13:56 dev.cyrusjayson Hey if I do this way, still okay? $this->con->execute("INSERT profiles (id)VALUES(?)",[$id]);
# Today, 13:52 neon1024 Oh, hey @dereuromark :wave:
# Today, 12:56 dereuromark You can, sure
# Today, 12:56 jotpe So i guess it should be fine to have it more specific.
# Today, 12:56 dereuromark In those cases best to ignore those then.
# Today, 12:55 jotpe It's a upload Behavior I use several times in my application.
# Today, 12:55 jotpe The IDeHelper CLI doesn't handle Behaviors
# Today, 12:55 dereuromark But for project level ones those are OK to have IMO.
# Today, 12:54 dereuromark I dont think my helper fixes behaviors yet. Usually, if you need this then the behavior is not as "agnostic" as behaviors usually are supposed to be.
# Today, 12:53 jotpe Hm
# Today, 12:50 dereuromark no this one: https://github.com/cakephp/bake/issues/456 and the linked ideHelper code
# Today, 12:47 jotpe THanks @dereuromark you mean this? https://github.com/dereuromark/cakephp-ide-helper/blob/master/src/Annotator/ModelAnnotator.php#L127
# Today, 12:38 dereuromark see also what Ide Helper here does for other callbacks in model code.
# Today, 12:37 dereuromark that works usually
# Today, 12:37 javier.villanueva @johizzle problem is that dont save the relationship in users_groups
# Today, 12:37 dereuromark to please phpstan you can set the concrete object into the docblock
# Today, 12:35 jotpe Is there a way to declare a property of a entity in a Behavior? F.e. I use this in my Behaviors `beforeSave()`: `$entity->storage_filename` PHPStan now says: `Access to an undefined property Cake\ORM\Entity::$storage_filename.` I set the storage_filename in `beforeMarshal()`
# Today, 12:32 johizzle $user->setDirty('groups', true); - you can try this
# Today, 12:26 javier.villanueva I use it, but always groups in user is [ ]
# Today, 12:25 javier.villanueva $data = []; $data['groups'] = $groups; $user = $this->get($user_id); $user = $this->patchEntity($user, $data); $this->save($user);
# Today, 12:17 javier.villanueva (is not a new entity)
# Today, 12:16 javier.villanueva I understand the simple association, but when there are multiple groups
# Today, 12:16 javier.villanueva I the https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-belongstomany-associations example
# Today, 12:15 javier.villanueva I dont understand a simple way to save belongsToMany associations (for instance users_groups) having user_id and array with groups_ids. I have read the doc... but
# Today, 11:36 jotpe Thanks @ndm I did another find in the Table method. It's a bit hacked, because I already have that data in my user Identity but it works ...
# Today, 11:31 dev.cyrusjayson thanks
# Today, 11:16 neon1024 https://book.cakephp.org/3.0/en/orm/saving-data.html#inserting-data
# Today, 11:16 neon1024 Yeah, you could do that if you wanted to. I prefer working with Entities
# Today, 11:13 ndm @jotpe There's no direct way, tables don't really care about the outside world. Depending on for what you need it, you'd usually either pass it to the table methods that you're calling, inject it into the table object (for example via a setter, or as an option via the table locator config), or pass it into the event flow via `Model.*` events options.
# Today, 11:02 dev.cyrusjayson ok. I am following this $query = $articles->query(); $query->insert(['title', 'body']) ->values([ 'title' => 'First post', 'body' => 'Some body text' ]) ->execute();
# Today, 10:55 neon1024 `$example = $this->Examples->newEntity(); $this->Examples->save($example)`
# Today, 10:54 neon1024 You should be building and entity and saving it
# Today, 10:54 neon1024 Don’t do that.
# Today, 10:45 dev.cyrusjayson how to do it in insert and update? This is my current code $output = $this->con->execute("INSERT INTO users (email, password)VALUES('$email', '$haspassword')");
# Today, 10:39 jotpe Or the Identity Object?
# Today, 10:38 jotpe Is there a way to access the Authentication Service from the Authentication Plugin within a Table class? https://book.cakephp.org/authentication/1.1/en/identity-object.html#the-identity-object
# Today, 10:00 dev.cyrusjayson @neon1024 I love you man! :kissing_heart: :P
# Today, 09:59 neon1024 If you know the scalar type expected
# Today, 09:58 neon1024 You can still do a little sanitization by casting values and such though
# Today, 09:58 neon1024 https://book.cakephp.org/3.0/en/orm/query-builder.html#sql-injection-prevention
# Today, 09:57 neon1024 `$this->Examples->find()->where(['thing' => $this->getRequest()->getData('something')])`
# Today, 09:57 neon1024 As long as they’re assigned as array values
# Today, 09:57 neon1024 The ORM will sanitize things for you
# Today, 09:55 dev.cyrusjayson it is an API
# Today, 09:55 david when I validate an input, the Form helper add the "Form.errorClass" to the input. But if I validate a select multiple, it doesn't add de "Form.errorClass" to the select. I am looking at the templates (https://api.cakephp.org/3.8/source-class-Cake.View.Helper.FormHelper.html#79-171) but I don't know how to do that
# Today, 09:54 dev.cyrusjayson I know it is not nice.
# Today, 09:54 dev.cyrusjayson in cake 2 there is a module call sanitize and they removed it in 3. any alternative that I can do something like this $email = CleanerSample($this->request->data['email'])
# Today, 09:53 alexdd55976 @dev.cyrusjayson you could iterate and clean things up or validate againt some madeup validation rules
# Today, 09:50 dev.cyrusjayson Guys, I accept parameters and directly put in my query builder so it is vulnerable in SQL Injection. is there a way to clean the $this->request->data in the middleware or appcontroller.php ? "$this->request->data['email']" 3.4.13
# Today, 09:07 jotpe Thank you :slightly_smiling_face:
# Today, 09:06 jotpe ok
# Today, 09:06 savant that’ll be more or less instant
# Today, 09:06 savant import it into a temporary table and execute sql to do two table renames in a single statement
# Today, 09:05 savant so ingest that data once a week or whatever
# Today, 09:05 jotpe Yes, they're known in advance. But i don't want end up managing zip code data, if something changes
# Today, 09:05 admad use a db table and update from time to time as required
# Today, 09:04 admad ditto
# Today, 09:04 savant if they are known in advance, i’d probably have them in a database so I can do a quick lookup
# Today, 09:01 jotpe Off-Cake Question: Do you use a Lib or Service to resolve zip codes to cities (especially german postleitzahlen)?
# Today, 08:33 admad *none
# Today, 08:32 admad no besides 2.10 in 2.x series
# Today, 08:31 tokam how about 2.1.1?
# Today, 08:30 admad 2.9 won't have any new bugfix release
# Today, 08:30 admad okay, like i said upgrade to latest 2.10.x and if issue persists submit a bug report
# Today, 08:30 tokam but this is not enough.
# Today, 08:29 tokam I tries to do this validation with if ( (!isset($this->_values[$this->name][$firstName])
# Today, 08:29 tokam and be also backwards compatible
# Today, 08:29 tokam and if I use an api that manages cookies, the API should do that.
# Today, 08:29 tokam it comes from $_COOKIES
# Today, 08:29 tokam no
# Today, 08:28 admad you should validate user input
# Today, 08:27 tokam string(64) " %'w/ Bo" x}%2 D @ B 2ӵ Mand [ y U0 W vh "
# Today, 08:27 tokam Some user had this value in this variable
# Today, 08:27 tokam $this->_values[$this->name][$firstName]
# Today, 08:27 admad it's more likely the problem is in your app rather than core code, 2.x code is very mature.
# Today, 08:26 admad FYI you just need a github account to be able to contribute
# Today, 08:26 tokam I think the issue is that some weird value gets into the system after the upgrade.
# Today, 08:26 admad that's more like it. Upgrade to latest 2.10.x and if you still have error then you can submit a bug report or fix.
# Today, 08:26 tokam But this fixed just one of the cases.
# Today, 08:23 tokam ////////////////////////////////////////////////////////////////////////////////////////////////////
# Today, 08:23 tokam 2.9.0
# Today, 08:10 admad tokam: i highly doubt you are using "0.2.9", what's the actual version?
# Today, 07:55 tokam can you please confirm that this is the correct bugfix? If possible maybe also add me to contributors, unless this is way too much to ask?
# Today, 07:55 tokam In CookieComponent.php
# Today, 07:55 tokam if ( (!isset($this->_values[$this->name][$firstName]) || $this->_values[$this->name][$firstName] == '') andand $isMultiValue) {
# Today, 07:55 tokam and replaced it by this one
# Today, 07:55 tokam if
# Today, 07:55 tokam f ( (!isset($this->_values[$this->name][$firstName]) ) andand $isMultiValue) {
# Today, 07:55 tokam We changed this line ...
# Today, 07:48 jotpe Morning
# Today, 07:42 kgb.acct.personal In CakePHP 2, what's the proper way to render exceptions as JSON?
# Today, 07:01 tokam maybe in a previous version a string was used, and it is still serialized in a cookie?
# Today, 07:01 tokam $this->_values[$this->name][$firstName] = Hash::insert(
# Today, 07:01 tokam $this->_values[$this->name][$firstName],
# Today, 07:01 tokam $names[1],
# Today, 07:01 tokam );