# |
Nov 23rd 2017, 08:31 |
d-fens |
is it currently not possible to have routes that any anonymous user can access when activating the cakedc/users plugin as 'bypassAuth' => true doesn't work? |
# |
Nov 23rd 2017, 08:25 |
slackebot2 |
give advice to me. thanks all. |
# |
Nov 23rd 2017, 08:25 |
chan |
i create 404 not found page with cakephp 2 by following link http://findnerd.com/list/view/How-to-make-custom-error-pages-in-cakephp/10516/ calling coding is ``` AdminAppController.php public function beforeFilter() { if ($this->request->is('mobile')) { // to return a 404 error throw new NotFoundException('Could not find that post'); } ``` why page is no show? only show => page can't be found (browser default page) if you know, please |
# |
Nov 23rd 2017, 05:36 |
voycey |
I do have my tests setup a different way but nothing that should kill it in my opinion |
# |
Nov 23rd 2017, 05:35 |
voycey |
hmm |
# |
Nov 23rd 2017, 05:34 |
admad |
latest core should work with phpunit 6 |
# |
Nov 23rd 2017, 05:34 |
voycey |
after downgrading phpunit to 5.x it all works again |
# |
Nov 23rd 2017, 05:34 |
voycey |
when I did the update |
# |
Nov 23rd 2017, 05:34 |
voycey |
it put it up to 3.5.6 |
# |
Nov 23rd 2017, 05:33 |
admad |
composer show cakephp/cakephp |
# |
Nov 23rd 2017, 05:33 |
voycey |
everything died a sad sad death |
# |
Nov 23rd 2017, 05:33 |
voycey |
I just had phpunit "*" and that |
# |
Nov 23rd 2017, 05:32 |
voycey |
is that enough? |
# |
Nov 23rd 2017, 05:32 |
voycey |
"cakephp/cakephp": "^3.0", |
# |
Nov 23rd 2017, 05:32 |
admad |
@voycey make sure you are using latest/recent core |
# |
Nov 23rd 2017, 03:00 |
voycey |
Ive just upgraded phpunit to version 6 but am getting a ton of errors for basic tests - is there anything I should know with it and cake? |
# |
Nov 23rd 2017, 01:11 |
slackebot2 |
language to the one extracted from the url. This results in title field from the attributes table being treated as if it were in another language not the one specified on app.php. How do I correctly tell my app, that if the current language is latvian, take title from the attributes table, but if it is another language, take it from the attributes_i18n table? |
# |
Nov 23rd 2017, 01:11 |
maris |
Wait, I think i don't quite understand how translations work. Currently I have attributes table, that has a title field with content in Latvian language. I also have a attributes_18n table that holds the title field values in other languages, for example, english. So in app.php the 'defaultLocale' => 'lv' I have a middleware that detects the chosen language from url and sets it using I18n::setLocale. But what this does is change the default |
# |
Nov 23rd 2017, 00:20 |
maris |
Hi! I hope someone can help me with translations. I have a model called "Attribute" that has translations enabled. This model is associated with model "Product". When I request a certain product and include attribute in "contain", the attribute returned is in default language rather than the one currently set. Is this the expected behaviour? |
# |
Nov 22nd 2017, 23:43 |
d-fens |
hey why are only my css files not cached but laoded on every request |
# |
Nov 22nd 2017, 22:50 |
raul338 |
no, firt try with a real file |
# |
Nov 22nd 2017, 22:37 |
joopp |
if i left empty the $path $file = $this->validateFile(); this still do something |
# |
Nov 22nd 2017, 22:36 |
joopp |
from your link : $file = $this->validateFile($path); |
# |
Nov 22nd 2017, 22:31 |
joopp |
okey and if the path is wrong the file will never exist |
# |
Nov 22nd 2017, 22:31 |
raul338 |
https://api.cakephp.org/3.5/source-class-Cake.Http.Response.html#2544 |
# |
Nov 22nd 2017, 22:31 |
raul338 |
if the file does not exists, cake prepends APP directory |
# |
Nov 22nd 2017, 22:31 |
raul338 |
and mypaths is a folder (trailing \) |
# |
Nov 22nd 2017, 22:31 |
raul338 |
acording to the code, it checks that the file exists |
# |
Nov 22nd 2017, 22:28 |
joopp |
the same as he has : https://stackoverflow.com/questions/45557691/file-path-setting-of-this-response-file-cakephp3 |
# |
Nov 22nd 2017, 22:27 |
joopp |
and now the $this->response->file('','') first parameter has already some values in mycase the APP_DIR |
# |
Nov 22nd 2017, 22:26 |
joopp |
$mypath='C:\xampp\htdocs\cakeproject\webroot\uploads\rob\' |
# |
Nov 22nd 2017, 22:25 |
raul338 |
value |
# |
Nov 22nd 2017, 22:25 |
raul338 |
and what is mypath ? |
# |
Nov 22nd 2017, 22:25 |
blackjccl |
File uploaded https://cakesf.slack.com/files/U5V7HDBHC/F83RTEYJC/-.php / https://slack-files.com/T053DPNCM-F83RTEYJC-c7d19cad0e - you can use the pagination helper with a stored procedure |
# |
Nov 22nd 2017, 22:23 |
joopp |
$mypath will became APP_DIR.DS.$mypath |
# |
Nov 22nd 2017, 22:23 |
joopp |
$this->response->file('$mypath', array('download' => true,'name' => $file->name,)); |
# |
Nov 22nd 2017, 22:22 |
joopp |
but no matter my path paraeter gets extra APP_DIR |
# |
Nov 22nd 2017, 22:22 |
blackjccl |
Hi guys, I searched the entire network of how to use the pagination or the cakephp 3 helper when you work with a stored procedure with something like that |
# |
Nov 22nd 2017, 22:22 |
joopp |
i have the two parameter |
# |
Nov 22nd 2017, 22:22 |
raul338 |
https://book.cakephp.org/3.0/en/controllers/request-response.html#sending-files |
# |
Nov 22nd 2017, 22:21 |
raul338 |
and i see you are passing 3 |