# |
Apr 17th 2019, 20:38 |
ricksaccous |
via buildRules |
# |
Apr 17th 2019, 20:38 |
ricksaccous |
avoiding the exception is best imo which you can do |
# |
Apr 17th 2019, 20:38 |
rightscoreanalysis |
I have a try catch in place |
# |
Apr 17th 2019, 20:37 |
ricksaccous |
you could always try catch but i think there is a way to change it |
# |
Apr 17th 2019, 20:36 |
rightscoreanalysis |
hmm, there must be a way to change the exception behaviour |
# |
Apr 17th 2019, 20:03 |
ricksaccous |
yeah but i recommend doing both |
# |
Apr 17th 2019, 20:02 |
rightscoreanalysis |
Oh so this would enable me to by-pass setting up fk constraints at db level and use Cake to check |
# |
Apr 17th 2019, 20:01 |
rightscoreanalysis |
seems a 500 error is thrown, can I force this error to use my own custom excpetio which I have setup |
# |
Apr 17th 2019, 20:01 |
ricksaccous |
and existsIn |
# |
Apr 17th 2019, 20:01 |
ricksaccous |
use buildRules |
# |
Apr 17th 2019, 19:57 |
rightscoreanalysis |
.. with the default cake error view |
# |
Apr 17th 2019, 19:57 |
rightscoreanalysis |
Is there a way to elegantly catch PDO exception, I'm using the CRUD plugin and if I test a call with fails due to a fk constraint the request die ungracefully |
# |
Apr 17th 2019, 17:37 |
dereuromark |
`bin/cake upgrade skeleton -f path/to/app` |
# |
Apr 17th 2019, 17:36 |
dereuromark |
I thought you meant for local copy or deploy. here you should use composer only. |
# |
Apr 17th 2019, 17:35 |
dereuromark |
you when for upgrading? here copying it over (using e.g. my upgrade skeleton command) is fine of course |
# |
Apr 17th 2019, 17:35 |
cpierce |
@ricksaccous yes my skeleton was outdated - i'm not sure how to correct that without copying though |
# |
Apr 17th 2019, 17:34 |
cpierce |
@dereuromark what is the preferred way of getting newer updated files in your app then? |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
but i see what you mean |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
i think his issue was an outdated app skeleton |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
oh |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
i'm a serial copy paster |
# |
Apr 17th 2019, 17:33 |
dereuromark |
inside php and deployment of such composer files you can easily screw up the paths in the cached files |
# |
Apr 17th 2019, 17:32 |
ricksaccous |
@dereuromark my dev lead would have loved to hear you say that |
# |
Apr 17th 2019, 17:29 |
dereuromark |
recipe for failure |
# |
Apr 17th 2019, 17:29 |
dereuromark |
never copy anything |
# |
Apr 17th 2019, 17:20 |
cpierce |
i forgot to copy new cake files to the bin folder |
# |
Apr 17th 2019, 17:20 |
cpierce |
ahh found it |
# |
Apr 17th 2019, 17:18 |
cpierce |
i don't know what i've done worng - i was just updating to the latest version |
# |
Apr 17th 2019, 17:18 |
cpierce |
it's still broken |
# |
Apr 17th 2019, 17:14 |
cpierce |
and had composer pull it again |
# |
Apr 17th 2019, 17:14 |
cpierce |
i deleted vendor folder |
# |
Apr 17th 2019, 17:13 |
admad |
You have somehow messed up autoloading |
# |
Apr 17th 2019, 17:12 |
cpierce |
no |
# |
Apr 17th 2019, 17:12 |
dereuromark |
are you testing a plugin? |
# |
Apr 17th 2019, 17:11 |
cpierce |
anyone help me out on the cause of this issue? ... obviously it's referencing it in the vendor file so i'd assume i'm missing something that should be installed |
# |
Apr 17th 2019, 17:10 |
cpierce |
```./bin/cake PHP Fatal error: Uncaught Error: Class 'Cake\Routing\Router' not found in /var/www/cpierce-testing/vendor/cakephp/cakephp/config/bootstrap.php:22 Stack trace: #0 /var/www/cpierce-testing/config/bootstrap.php(30): require() #1 /var/www/cpierce-testing/bin/cake.php(31): include('/var/www/cpierc...') #2 {main} thrown in /var/www/cpierce-testing/vendor/cakephp/cakephp/config/bootstrap.php on line 22``` |
# |
Apr 17th 2019, 16:27 |
ksc |
To explain what i try to do: I try to increment an order number based on one client. -> pair of "client_id" and "order_nbr" should be unique. I call a generateOrderNbr function in the beforeSave() function of my orders table. I tried the buildrules, but this doesn't work: $rules->add($rules->isUnique(['client_id', 'order_nbr'], _('Order No. has to be unique.'))); |
# |
Apr 17th 2019, 16:17 |
ksc |
Hi, is real uniqueness for 2 combined columns with CakePHP 3 possible if it's not configured in mysql as UNIQUE INDEX ? |
# |
Apr 17th 2019, 16:04 |
facuvillard |
Okey okey! Thanks! |
# |
Apr 17th 2019, 15:58 |
steinkel |
@facuvillard there is a specific channel for spanish support |
# |
Apr 17th 2019, 15:56 |
neon1024 |
Also I believe that @steinkel is a Spanish speaker, so might be able to advise further :slightly_smiling_face: |