# |
Dec 20th 2019, 13:18 |
dsar |
@tibor.hajos Documentation also needs contributions, e.g. more tutorials about common use cases |
# |
Dec 20th 2019, 13:18 |
gianmarxgagliardi |
```public function index() { $this->paginate = [ 'contain' => ['SeasonReferees', 'Clubs'], ]; $matchs = $this->paginate($this->Matchs); $this->set(compact('matchs')); }``` |
# |
Dec 20th 2019, 12:38 |
ceeram |
you'd better @tibor.hajos |
# |
Dec 20th 2019, 10:35 |
tibor.hajos |
Awesome :) I'll do my best |
# |
Dec 20th 2019, 10:27 |
dereuromark |
@tibor.hajos go for it :) |
# |
Dec 20th 2019, 10:11 |
jotpe |
Hi folks! It's friday :tada: |
# |
Dec 20th 2019, 10:04 |
slackebot |
something easy to start of with. Is this currently being worked on? And if not, could I please make an attempt? |
# |
Dec 20th 2019, 10:04 |
tibor.hajos |
Hello all! I have been using cake for a few months now and I would like to contribute in order to give back to people that have been making my life easier and in order to improve my coding skills. I also need an excuse to get into the source code of Cake as I have an urge to take a look at it :) At the 4.1 milestone (https://github.com/cakephp/cakephp/wiki/4.1-Roadmap) I noticed the log message creation needs improvement. This seems |
# |
Dec 20th 2019, 09:40 |
gianmarxgagliardi |
ok perfect. now I try to cook everything again according to the conventions |
# |
Dec 20th 2019, 09:39 |
challgren |
But without seeing your rules can’t really say for sure |
# |
Dec 20th 2019, 09:38 |
challgren |
but one issue I see is your Matches.referee_id should be Matches.season_referee_id to follow cake naming conventions |
# |
Dec 20th 2019, 09:37 |
challgren |
Oh NM |
# |
Dec 20th 2019, 09:37 |
challgren |
That needs to be in your Matches table |
# |
Dec 20th 2019, 09:36 |
slackebot |
<challgren> |
# |
Dec 20th 2019, 09:34 |
slackebot |
$this->setPrimaryKey('id'); $this->belongsTo('SeasonReferees', [ 'foreignKey' => 'referee_id', 'joinType' => 'INNER', ]); $this->belongsTo('Clubs', [ 'foreignKey' => 'club_home_id', 'joinType' => 'INNER', ]); $this->belongsTo('Clubs', [ 'foreignKey' => 'club_visitor_id', 'joinType' => 'INNER', ]); }``` |
# |
Dec 20th 2019, 09:34 |
slackebot |
$this->belongsTo('Referees', [ 'foreignKey' => 'referee_id', 'joinType' => 'INNER', ]); $this->hasMany('Matchs', [ 'foreignKey' => 'referee_id', ]); }``` While in the model>table for Matchs: ``` public function initialize(array $config) { parent::initialize($config); $this->setTable('matchs'); $this->setDisplayField('id'); |
# |
Dec 20th 2019, 09:34 |
gianmarxgagliardi |
hi I have an insertion problem, it gives me: `"ExistsIn rule for 'referee_id' is invalid. 'Referees' is not associated with 'App\Model\Table\MatchsTable'."` In the model>table for SeasonReferees: ``` public function initialize(array $config) { parent::initialize($config); $this->setTable('season_referees'); $this->setDisplayField('id'); $this->setPrimaryKey('id'); |
# |
Dec 20th 2019, 08:29 |
gianmarxgagliardi |
morning |
# |
Dec 20th 2019, 06:51 |
megan |
morning :) |
# |
Dec 20th 2019, 04:44 |
challgren |
Cake\Http\Client to download files? |
# |
Dec 20th 2019, 04:43 |
challgren |
Whats the best way to use |
# |
Dec 20th 2019, 02:33 |
kani |
cake 4 not loading plugin route |
# |
Dec 19th 2019, 21:19 |
alexmax |
Thanks for responding though |
# |
Dec 19th 2019, 21:17 |
alexmax |
I did notice that many of our sessions at rest in redis were missing user data that ought to have been put there. |
# |
Dec 19th 2019, 21:17 |
alexmax |
I suspect DNS tomfoolery |
# |
Dec 19th 2019, 21:17 |
alexmax |
I'm using redis for sessions, and the problem seems to have gone away on its own - we're in the process of migrating dev servers and the problem only occurred when both sets of servers were alive, and only at first, it went away on its own and we haven't noticed a problem since |
# |
Dec 19th 2019, 20:05 |
noel |
@alexmax Are you using file or db sessions? Do you have a timeout on the sessions? If you're storing session files to /tmp and that folder is getting cleared out periodically, that could trash your session files and invalidate the session. |
# |
Dec 19th 2019, 19:59 |
admad |
if you are using cake 4 you need `initialize(): void`, though what you have should throw and error not crash php |
# |
Dec 19th 2019, 19:46 |
japerlman |
putting it right under class xxxxController extends AppController{ |
# |
Dec 19th 2019, 19:45 |
japerlman |
``` public function initialize() { parent::initialize(); $this->loadComponent('RequestHandler'); }``` |
# |
Dec 19th 2019, 19:45 |
japerlman |
Anyone have any idea why the below snippet would crash the PHP service on my device? It's straight from the cake book. |
# |
Dec 19th 2019, 18:41 |
alexmax |
(it's a dev site, so I can blow it up if I need to) |
# |
Dec 19th 2019, 18:41 |
alexmax |
Is there some way I can log the _reason_ for why authentication invalidates a session? |
# |
Dec 19th 2019, 18:40 |
alexmax |
I'm running a Cake 3.5 site and am running into some mysterious instances where sessions just seem to....die randomly, and users are getting logged out of auth-component-protected pages. |
# |
Dec 19th 2019, 18:13 |
noel |
huzzah! |
# |
Dec 19th 2019, 17:46 |
noel |
ok I suppose I need to figure out where PHP is logging errors to then. |
# |
Dec 19th 2019, 17:44 |
admad |
cake and log shit and it didnt even get past the bootstrapping stage |
# |
Dec 19th 2019, 17:43 |
noel |
Yeah.. phew.. ok I found the error. It's a syntax error I made recently in bootstrap.php but wtf am I not getting any logged errors – neither to screen nor to cake logs nor to apache logs... just a white-out. |
# |
Dec 19th 2019, 17:37 |
savant |
are you running the right php version? |
# |
Dec 19th 2019, 17:23 |
noel |
no errors logged by apache either |
# |
Dec 19th 2019, 17:21 |
noel |
it's not making it as far as `bootstrap.php` even... I put a die command in there. Seems to make it into `webroot/index.php` and then chokes on `emit($server->run());` |