# |
Feb 20th 2020, 07:59 |
slackebot |
<christianjohn.gss> |
# |
Feb 20th 2020, 07:58 |
admad |
did you forget to call parent::beforeRender() ? |
# |
Feb 20th 2020, 07:56 |
christianjohn.gss |
i am currently using adminlte theme at cakephp 3 and i was trying to set the default route to a login page, and when i write a beforeRender function, the theme went away even without the setTheme(null) |
# |
Feb 20th 2020, 07:55 |
christianjohn.gss |
i got a question |
# |
Feb 20th 2020, 07:55 |
christianjohn.gss |
hello |
# |
Feb 20th 2020, 07:42 |
alexdd55976 |
morning el duderinos |
# |
Feb 20th 2020, 07:07 |
javier.villanueva |
morning all |
# |
Feb 20th 2020, 06:57 |
serz |
I don’t understand what kind of config, there is a view in the app folder, config some kind of file |
# |
Feb 20th 2020, 06:34 |
admad |
or php fpm |
# |
Feb 20th 2020, 06:34 |
admad |
restart your webserver |
# |
Feb 20th 2020, 06:34 |
admad |
on in your cake app's config use config name "cake" instead of "php" so that cake uses tmp/sessions folder of your cake app to store session files |
# |
Feb 20th 2020, 06:34 |
serz |
thanks for the answer, changed the path to the tmp folder nothing changes |
# |
Feb 20th 2020, 06:32 |
admad |
fix the path to folder where php stores session files through php.ini config |
# |
Feb 20th 2020, 06:30 |
serz |
7.4 |
# |
Feb 20th 2020, 06:30 |
serz |
after updating cakephp to version 2.10.20 and changing php version to 7.4, before that there was version 5.6, the site refuses to worksession_start (): Failed to read session data: user (path: / var / lib / php / sessions) with permissions there are no problems if you switch to php 5.6 and everything works fine, tell me who had problems with php |
# |
Feb 20th 2020, 06:30 |
serz |
hi |
# |
Feb 20th 2020, 05:59 |
itamer |
cake3 - I'm just trawling through the logs and thought I'd add the common obvious problem requests to routes.php and send them on their way - more visible than .htaccess so I have ```$routes->redirect('/wp-*', '/', ['status' => 404]); $routes->redirect('/app/*', '/', ['status' => 404]); $routes->redirect('/app-ads.txt', '/', ['status' => 404]);``` |
# |
Feb 20th 2020, 05:46 |
le.mao |
Opp! sorry I got a mistake typo. The version cake on my system is 2.2.5 It seems that I need to upgrade to a new Cake version right now. Do you have any way for flash resolve as a method temp while waiting for upgrade to a new cake version. Because, I think when I upgrade to new Cake version. There are lots of thing need to test on server for my website. Thank you so much |
# |
Feb 20th 2020, 05:39 |
nate |
That said I believe PHP7 support only officially started w/ CakePHP 2.8.0 |
# |
Feb 20th 2020, 05:39 |
nate |
slackebot: Could you double check that version...? Cause literal 0.2.9 would imply like 14~ year old version of CakePHP |
# |
Feb 20th 2020, 05:27 |
le.mao |
I have just upgrade PHP5 to PHP7. the version current cake is v 0.2.9. However, After upgrade the PHP version I have an error about the Object class ``` Fatal error: Cannot use 'Object' as class name as it is reserved in xxx/Cake/Core/Object.php on line 26``` Could you please tell me about this error? Thank you |
# |
Feb 20th 2020, 05:26 |
matiur756 |
hello |
# |
Feb 20th 2020, 05:25 |
le.mao |
Hello everyone |
# |
Feb 19th 2020, 23:28 |
ndm |
you're welcome |
# |
Feb 19th 2020, 23:28 |
wizardfix |
Thanks so much @ndm :-) |
# |
Feb 19th 2020, 23:28 |
ndm |
:) |
# |
Feb 19th 2020, 23:27 |
wizardfix |
Hey it just worked by putting the `contain()` at the top! :) ```public function index() { $this->paginate = [ 'contain' => ['Creators'], 'limit' => 30 ]; $users = $this->paginate($this->Users ->find() ->where(['Users.status <' => 2])); debug($users); $this->set(compact('users')); }``` |
# |
Feb 19th 2020, 23:27 |
ndm |
`$this->paginate = []` is the config |
# |
Feb 19th 2020, 23:27 |
ndm |
```public function index() { $this->paginate = [ 'limit' => 30 ]; $users = $this->paginate( $this->Users ->find() ->contain('Creators') ->where(['status <' => 2]) ); debug($users); $this->set(compact('users')); }``` |
# |
Feb 19th 2020, 23:26 |
ndm |
like this |
# |
Feb 19th 2020, 23:26 |
ndm |
Or wait... putting a limit on the query is probably stupid :) I guess that would break the pagination, but contain could work... so in any case, swap the code, add `contain()` if you like... |
# |
Feb 19th 2020, 23:25 |
wizardfix |
What do you mean by "the config"; and, how to call `contain()` on the query |
# |
Feb 19th 2020, 23:25 |
ndm |
What exactly, swapping or modifying the query? |
# |
Feb 19th 2020, 23:24 |
wizardfix |
How so? :thinking_face: |
# |
Feb 19th 2020, 23:24 |
ndm |
You'd need to swap that, the config must be set before doing the `paginate()` call... however you can also just call `contain()` and `limit()` on the query directly. |
# |
Feb 19th 2020, 23:23 |
wizardfix |
```public function index() { $users = $this->paginate($this->Users ->find() ->where(['status <' => 2])); $this->paginate = [ 'contain' => ['Creators'], 'limit' => 30 ]; debug($users); $this->set(compact('users')); }``` |
# |
Feb 19th 2020, 23:22 |
wizardfix |
```$this->paginate = [ 'contain' => ['Creators'], 'limit' => 30 ];``` in my view function |
# |
Feb 19th 2020, 23:22 |
ndm |
There is no creator... do you actually contain the association? |
# |
Feb 19th 2020, 23:21 |
slackebot |
false }, '[new]' => false, '[accessible]' => [ 'name' => true, 'email' => true, 'admin' => true, 'password' => true, 'status' => true, 'created_by' => true, 'created_on' => true ], '[dirty]' => [], '[original]' => [], '[virtual]' => [], '[hasErrors]' => false, '[errors]' => [], '[invalid]' => [], '[repository]' => 'Users' },``` A user from the list |
# |
Feb 19th 2020, 23:21 |
wizardfix |
```(int) 3 => object(App\Model\Entity\User) { 'id' => (int) 5, 'name' => 'Zaphod Beeblebrox', 'email' => 'infinite@galactic.net', 'admin' => false, 'password' => '$2y$10$M1IptedUMTnzyuolZF4uVOsSadqIoPn9kh8LHN7UXQC/0Z7WbYfvu', 'status' => (int) 1, 'created_by' => (int) 2, 'created_on' => object(Cake\I18n\FrozenTime) { 'time' => '2020-01-20 18:06:00.000000+00:00', 'timezone' => 'UTC', 'fixedNowTime' => |
# |
Feb 19th 2020, 23:20 |
wizardfix |
No, I just want to display theuser's name instead of the id. You showed me how to do this a couple of days ago when I was creating an association to a *different* table, but this time it doesn't seem to work the same- the default alias would cause a clash - `user` vs. `user`. |