# |
Nov 6th 2019, 16:02 |
dereuromark |
yeah, bad idea IMO |
# |
Nov 6th 2019, 16:01 |
noel |
Oh ok thanks. The docs specifically say that unique should be domain validation – I wonder why that is? |
# |
Nov 6th 2019, 16:00 |
dereuromark |
PS: I recommend first setting up normal validation rules, not domain rules. Especially also for Unique etc. Combined with other rules it would otherwise behave badly. |
# |
Nov 6th 2019, 16:00 |
dereuromark |
check the docs here |
# |
Nov 6th 2019, 16:00 |
dereuromark |
You might have to return the rules at the end? |
# |
Nov 6th 2019, 15:57 |
slackebot1 |
Cake\ORM\Table->checkRules(Object(App\Model\Entity\Device), 'create', Object(ArrayObject)) #1 /Users/me/project/vendor/cakephp/cakephp/src/ORM/Table.php(1933): Cake\ORM\Table->_processSave(Object(App\Model\Entity\Device), Object(ArrayObject)) #2 /Users/me/project/vendor/cakephp/cakephp/src/ORM/Table.php(1638): Cake\ORM\Table->Cake\ORM\{closure}() ``` |
# |
Nov 6th 2019, 15:57 |
slackebot1 |
function buildRules(RulesChecker $rules) { $rules->add($rules->isUnique( ['name'], 'This device is already registered.' )); } } ``` Here's the error: ``` 2019-11-06 15:47:28 Error: [Error] Call to a member function check() on null (/Users/me/project/vendor/cakephp/cakephp/src/Datasource/RulesAwareTrait.php:65) #0 /Users/me/project/vendor/cakephp/cakephp/src/ORM/Table.php(1994): |
# |
Nov 6th 2019, 15:57 |
noel |
Hi all. I'm trying to get started with 3.x validation and have run straight into a wall. I'm able to save from Postman when there's no validation. When I try to add in isunique validation then it breaks. Here's the table: ``` <?php namespace App\Model\Table; use Cake\ORM\Query; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; use Cake\ORM\Rule\IsUnique; class DevicesTable extends Baked\DevicesTable { public |
# |
Nov 6th 2019, 15:33 |
jotpe |
@amanfulgence https://startbootstrap.com/ has some good templates |
# |
Nov 6th 2019, 14:14 |
mario_ |
thanks |
# |
Nov 6th 2019, 14:07 |
dereuromark |
Follow the book/docs/tutorial and bake some code. |
# |
Nov 6th 2019, 14:02 |
mario_ |
How learn conventions cakephp? |
# |
Nov 6th 2019, 14:02 |
mario_ |
Hi |
# |
Nov 6th 2019, 13:55 |
ricksaccous |
pidlo, what are you trying to do? |
# |
Nov 6th 2019, 13:50 |
rochasmarcelo |
That's why auth plugins should be a minor issue in 9.next |
# |
Nov 6th 2019, 13:48 |
rochasmarcelo |
Well 9.next is for CakePHP 4 only |
# |
Nov 6th 2019, 13:45 |
rochasmarcelo |
You'll need to create a custom action for this. |
# |
Nov 6th 2019, 13:40 |
pidlo |
i would like search something about setDefaultConnection and i get nothing.. |
# |
Nov 6th 2019, 13:38 |
admad |
http://google.com |
# |
Nov 6th 2019, 13:38 |
amanfulgence |
please give me link where i coul obtain |
# |
Nov 6th 2019, 13:37 |
admad |
you want link to google? |
# |
Nov 6th 2019, 13:37 |
amanfulgence |
please give me a link |
# |
Nov 6th 2019, 13:37 |
admad |
then ask google |
# |
Nov 6th 2019, 13:37 |
amanfulgence |
for hotel |
# |
Nov 6th 2019, 13:36 |
admad |
AdminLTE |
# |
Nov 6th 2019, 13:36 |
amanfulgence |
i need a well boostrap 4 template |
# |
Nov 6th 2019, 13:27 |
pidlo |
hello all in version 3 i use TableRegistry::get($m)->getConnection()->config()['name'] to get connection name which i set in model in static function setDefaultConnection now i get only Default.. |
# |
Nov 6th 2019, 13:25 |
nayakvradhit |
In cakephp 2.1 even there is a file called geocoded php in the app/model/behavior folder inside which is having class Geocoded behavior extends ModelBehavior blah blah But when I migrate it to cakephp 2.10 I placed the same geocoded.php file into app/model/behavior folder but I am getting missing GeocodedBehavior class can you please help me with this why I am getting this in cakephp 2.10.13 |
# |
Nov 6th 2019, 13:22 |
dereuromark |
but resend email with generated token and accepting action should be fairly simple to implement. |
# |
Nov 6th 2019, 13:22 |
dereuromark |
I dont have any public ones. and the sandbox doesnt provider register demo :slightly_smiling_face: sry |
# |
Nov 6th 2019, 13:19 |
rudy1976s |
@dereuromark could you please give me url of your app case ? |
# |
Nov 6th 2019, 13:13 |
nike90 |
Hi guys, I have a problem with require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';, I moved my system from a dev server to a live server, access is just with ip/cakephp, I copied also my .htaccess file from the dev server, any ideas? |
# |
Nov 6th 2019, 13:10 |
dereuromark |
I have re-send confirmation link feature here in my apps/cases. maybe you need to code that yourself or sth. |
# |
Nov 6th 2019, 13:09 |
rudy1976s |
because validation of the register fails |
# |
Nov 6th 2019, 13:09 |
rudy1976s |
I have user registrated which did not click registration confirmation link, and now the token has expired. Since the user is already in the table , set as active = 0 , the user is unable to register again |
# |
Nov 6th 2019, 13:08 |
rochasmarcelo |
@rudy1976s You can ask your question |
# |
Nov 6th 2019, 13:02 |
dereuromark |
aha ok |
# |
Nov 6th 2019, 12:56 |
val |
It looks like a dummy query is passed to `beforeFind` method instead of the main one. "For associations that use joins, a dummy query will be provided." - https://book.cakephp.org/3/en/orm/table-objects.html#beforefind So the mapper is not attached to the main query. |
# |
Nov 6th 2019, 12:52 |
dereuromark |
Thats why there is bool $primary param. If that is relevant to know, but for most behaviors it shold behave the same. |
# |
Nov 6th 2019, 12:51 |
dereuromark |
really? but then maybe there is some bug somewhere. as this is supposed to work from the model callback strategy. |
# |
Nov 6th 2019, 12:32 |
val |
That does not really work. F.ex. https://github.com/dereuromark/cakephp-tools/blob/master/src/Model/Behavior/BitmaskedBehavior.php - it works well when the model that uses Bitmasked is queried directly but if the associated model has Bitmasked then bitmasks are not converted to real values. |